Closed
Bug 1256424
Opened 10 years ago
Closed 10 years ago
Get rid of ThreadsafeAutoSafeJSContext
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla48
| Tracking | Status | |
|---|---|---|
| firefox48 | --- | fixed |
People
(Reporter: bzbarsky, Assigned: bzbarsky)
References
Details
Attachments
(1 file)
|
5.49 KB,
patch
|
bholley
:
review+
|
Details | Diff | Splinter Review |
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.
| Assignee | ||
Comment 1•10 years ago
|
||
Er, I meant ThreadsafeAutoSafeJSContext. ThreadsafeAutoJSContext will be more complicated. ;)
Summary: Get rid of ThreadsafeAutoJSContext → Get rid of ThreadsafeAutoSafeJSContext
| Assignee | ||
Comment 2•10 years ago
|
||
Attachment #8730365 -
Flags: review?(bobbyholley)
| Assignee | ||
Updated•10 years ago
|
Assignee: nobody → bzbarsky
Status: NEW → ASSIGNED
Comment 3•10 years ago
|
||
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+
| Assignee | ||
Comment 4•10 years ago
|
||
> 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)
Comment 5•10 years ago
|
||
(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)
Comment 8•10 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/21e5497ebb72
https://hg.mozilla.org/mozilla-central/rev/a5365af3f8c6
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla48
Updated•7 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•