Figure out what IDBFactory is doing with AutoJSAPI

RESOLVED FIXED in Firefox 48

Status

()

Core
DOM: IndexedDB
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: bz, Assigned: bz)

Tracking

Trunk
mozilla48
Points:
---

Firefox Tracking Flags

(firefox48 fixed)

Details

Attachments

(1 attachment)

In the mainthread case, we set up an AutoJSAPI using our existing AutoJSContext, but a possibly-different global (esp. in the Xray case).  This _may_ save a frame chain if the global we're using is not same-origin with the default global for that JSContext.

The only thing we seem to use this AutoJSAPI for is the CaptureCaller() bit that uses AutoJSContext and then does nsJSUtils::GetCallingLocation.

For the worker thread, the AutoJSAPI just seems completely unnecessary, since we have a perfectly good JSContext around anyway.

Seems to me like the right thing here is to just nix this AutoJSAPI altogether.  I don't think it's doing anything useful...
Created attachment 8729619 [details] [diff] [review]
Get rid of the AutoJSAPI usage in IDBFactory
Attachment #8729619 - Flags: review?(khuey)
Try run at https://treeherder.mozilla.org/#/jobs?repo=try&revision=8c9449875560 fwiw.
Comment on attachment 8729619 [details] [diff] [review]
Get rid of the AutoJSAPI usage in IDBFactory

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

::: dom/indexedDB/IDBFactory.cpp
@@ +731,1 @@
>                                        static_cast<nsGlobalWindow*>(reinterpret_cast<nsPIDOMWindow<nsISupports>*>(mWindow.get()))->FastGetGlobalJSObject());

While you're nearby can you just nsGlobalWindow::Cast here?
Attachment #8729619 - Flags: review?(khuey) → review+
> While you're nearby can you just nsGlobalWindow::Cast here?

Yep, done.

Comment 5

2 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/3149ea08a83f

Comment 6

2 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/3149ea08a83f
Status: NEW → RESOLVED
Last Resolved: 2 years ago
status-firefox48: affected → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla48
You need to log in before you can comment on or make changes to this bug.