OOP from a JS component or JSM doesn't work

RESOLVED FIXED in mozilla16

Status

()

Core
DOM: IndexedDB
RESOLVED FIXED
5 years ago
4 years ago

People

(Reporter: Ben Turner (not reading bugmail, use the needinfo flag!), Assigned: Ben Turner (not reading bugmail, use the needinfo flag!))

Tracking

(Blocks: 1 bug)

unspecified
mozilla16
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

Need to set up the actor machinery for windowless usage. Currently it crashes.

And then I guess I need to figure out some way to test this combination :-/
Assignee: nobody → bent.mozilla
Created attachment 641707 [details] [diff] [review]
Patch, v1

This patch is pretty simple, but the testing is a bit messy.

Anyway, I figured out how to mirror a JSM/JSComponent global so that I don't have to rework all the ownership stuff in the parent. I'm using a BackstagePass with a Null principal (not "no" principal), so if it ever escapes somehow it can't actually do anything. We only need it for the event handling stuff that happens during the open sequence.

Everything seems to work!
Attachment #641707 - Flags: review?(khuey)
Attachment #641707 - Flags: review?(jonas)
Comment on attachment 641707 [details] [diff] [review]
Patch, v1

Review of attachment 641707 [details] [diff] [review]:
-----------------------------------------------------------------

I think mrbkap or bholley should review the XPConnect abuse here.

::: dom/indexedDB/IDBFactory.cpp
@@ +182,5 @@
> +IDBFactory::Create(IDBFactory** aFactory)
> +{
> +  NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
> +  NS_ASSERTION(IndexedDatabaseManager::IsMainProcess(), "Wrong process!");
> +  NS_ASSERTION(nsContentUtils::IsCallerChrome(), "Only for chrome!");

I think instead of checking that the caller is chrome, you should check that the top JSContext on the stack is null.
Attachment #641707 - Flags: review?(khuey) → review+
Created attachment 642158 [details] [diff] [review]
Use a sandbox global, v1

Applies on top of the previous patch.
Attachment #642158 - Flags: review?(mrbkap)
Comment on attachment 642158 [details] [diff] [review]
Use a sandbox global, v1

r=me with a comment about why we need to unwrap there.
Attachment #642158 - Flags: review?(mrbkap) → review+
Attachment #641707 - Flags: review?(jonas)
https://hg.mozilla.org/integration/mozilla-inbound/rev/592bfc94e628
https://hg.mozilla.org/integration/mozilla-inbound/rev/1f9add03a089
Somehow the last time we ran the xpcshell tests on mac even though I tried to disable them. This time I've restricted them to just windows (hopefully).

https://hg.mozilla.org/integration/mozilla-inbound/rev/06ba7dd9f841
https://tbpl.mozilla.org/php/getParsedLog.php?id=13527895&tree=Mozilla-Inbound

TEST-INFO | /Users/cltbld/talos-slave/test/build/xpcshell/tests/dom/indexedDB/ipc/unit/test_add_put.js | running test ...

command timed out: 1200 seconds without output, attempting to kill
process killed by signal 9
program finished with exit code -1
elapsedTime=2725.067969
TinderboxPrint: xpcshell<br/><em class="testfail">T-FAIL</em>
buildbot.slave.commands.TimeoutError: command timed out: 1200 seconds without output, attempting to kill
TinderboxPrint: xpcshell<br/><em class="testfail">timeout</em>

Backout, please.
Yes, they don't work on mac. I've tried two different ways to disable them there, but I'm obviously not getting something right. Anyway, disabled entirely:

https://hg.mozilla.org/integration/mozilla-inbound/rev/6166a8e28786
https://hg.mozilla.org/mozilla-central/rev/06ba7dd9f841
https://hg.mozilla.org/mozilla-central/rev/6166a8e28786
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla16
Followup to run the tests somewhere, please.
Blocks: 776300
Blocks: 866734
You need to log in before you can comment on or make changes to this bug.