Closed Bug 1255840 Opened 8 years ago Closed 8 years ago

Figure out what IDBFactory is doing with AutoJSAPI

Categories

(Core :: Storage: IndexedDB, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla48
Tracking Status
firefox48 --- fixed

People

(Reporter: bzbarsky, Assigned: bzbarsky)

References

Details

Attachments

(1 file)

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...
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.
https://hg.mozilla.org/mozilla-central/rev/3149ea08a83f
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla48
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: