Last Comment Bug 772700 - OOP from a JS component or JSM doesn't work
: OOP from a JS component or JSM doesn't work
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: DOM: IndexedDB (show other bugs)
: unspecified
: All All
: -- normal (vote)
: mozilla16
Assigned To: Ben Turner (not reading bugmail, use the needinfo flag!)
:
Mentors:
Depends on:
Blocks: 866734 776300
  Show dependency treegraph
 
Reported: 2012-07-10 17:11 PDT by Ben Turner (not reading bugmail, use the needinfo flag!)
Modified: 2013-04-29 09:06 PDT (History)
8 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Patch, v1 (24.62 KB, patch)
2012-07-12 20:10 PDT, Ben Turner (not reading bugmail, use the needinfo flag!)
khuey: review+
Details | Diff | Splinter Review
Use a sandbox global, v1 (2.57 KB, patch)
2012-07-13 18:18 PDT, Ben Turner (not reading bugmail, use the needinfo flag!)
mrbkap: review+
Details | Diff | Splinter Review

Description Ben Turner (not reading bugmail, use the needinfo flag!) 2012-07-10 17:11:24 PDT
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 :-/
Comment 1 Ben Turner (not reading bugmail, use the needinfo flag!) 2012-07-12 20:10:04 PDT
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!
Comment 2 Kyle Huey [:khuey] (Exited; not receiving bugmail, email if necessary) 2012-07-13 14:12:42 PDT
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.
Comment 3 Ben Turner (not reading bugmail, use the needinfo flag!) 2012-07-13 18:18:44 PDT
Created attachment 642158 [details] [diff] [review]
Use a sandbox global, v1

Applies on top of the previous patch.
Comment 4 Blake Kaplan (:mrbkap) 2012-07-13 18:19:44 PDT
Comment on attachment 642158 [details] [diff] [review]
Use a sandbox global, v1

r=me with a comment about why we need to unwrap there.
Comment 5 Ben Turner (not reading bugmail, use the needinfo flag!) 2012-07-13 20:08:13 PDT
https://hg.mozilla.org/integration/mozilla-inbound/rev/592bfc94e628
Comment 7 Ben Turner (not reading bugmail, use the needinfo flag!) 2012-07-14 04:27:49 PDT
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
Comment 8 :Ms2ger (⌚ UTC+1/+2) 2012-07-14 05:59:14 PDT
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.
Comment 9 Ben Turner (not reading bugmail, use the needinfo flag!) 2012-07-14 06:16:38 PDT
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
Comment 11 :Ms2ger (⌚ UTC+1/+2) 2012-07-15 03:38:25 PDT
Followup to run the tests somewhere, please.

Note You need to log in before you can comment on or make changes to this bug.