Closed Bug 1256424 Opened 10 years ago Closed 10 years ago

Get rid of ThreadsafeAutoSafeJSContext

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla48
Tracking Status
firefox48 --- fixed

People

(Reporter: bzbarsky, Assigned: bzbarsky)

References

Details

Attachments

(1 file)

It's pretty weird in that it has totally different guarantees on workers and mainthread in terms of what compartments it enters and whether it puts an AutoJSAPI on the stack.... In practice, it has two consumers, one of which should be using AutoJSAPI and one of which just wants rooting. Let's kill this thing.
Er, I meant ThreadsafeAutoSafeJSContext. ThreadsafeAutoJSContext will be more complicated. ;)
Summary: Get rid of ThreadsafeAutoJSContext → Get rid of ThreadsafeAutoSafeJSContext
Attachment #8730365 - Flags: review?(bobbyholley)
Assignee: nobody → bzbarsky
Status: NEW → ASSIGNED
Comment on attachment 8730365 [details] [diff] [review] Get rid of ThreadsafeAutoSafeJSContext Review of attachment 8730365 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/base/DOMRequest.cpp @@ +302,3 @@ > const JS::Value& aResult) : > mReq(aRequest), > + mResult(CycleCollectedJSRuntime::Get()->Runtime(), aResult) RootingCxForThread would also be fine here. Doesn't really matter. ::: dom/promise/Promise.cpp @@ +1763,5 @@ > MOZ_ASSERT(mCountdown > 0); > > + AutoJSAPI jsapi; > + if (!jsapi.Init(mValues)) { > + // Now what? We could make the object-valued init infallible, though that would mean renaming it. Either way, this comment should probably go.
Attachment #8730365 - Flags: review?(bobbyholley) → review+
> We could make the object-valued init infallible Are we sure we can't end up with the nsIGlobalObject missing its pointer back to the global JSObject* even while JSObjects from that global are reachable? > RootingCxForThread would also be fine here. Er, right. I did that in the caller first, then realized I can just push it here. I'll change to RootingCxForThread.
Flags: needinfo?(bobbyholley)
(In reply to Boris Zbarsky [:bz] from comment #4) > > We could make the object-valued init infallible > > Are we sure we can't end up with the nsIGlobalObject missing its pointer > back to the global JSObject* even while JSObjects from that global are > reachable? I don't know.
Flags: needinfo?(bobbyholley)
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla48
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: