The default bug view has changed. See this FAQ.

OOP from a JS component or JSM doesn't work

RESOLVED FIXED in mozilla16



DOM: IndexedDB
5 years ago
4 years ago


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


(Blocks: 1 bug)

Dependency tree / graph

Firefox Tracking Flags

(Not tracked)



(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)
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).

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
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:
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.