Closed Bug 1371125 Opened 8 years ago Closed 8 years ago

Don't save JSContext in nsSameProcessAsyncMessageBase

Categories

(Core :: DOM: Content Processes, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla56
Tracking Status
firefox56 --- fixed

People

(Reporter: billm, Assigned: billm)

Details

Attachments

(1 file)

Attached patch patchSplinter Review
Saving a JSContext in nsSameProcessAsyncMessageBase causes problems for Quantum DOM. A message (with CPOWs) might be received on a different cooperative thread than the one it was sent, which involves a different context. We should look up the JSContext in TLS instead (via AutoJSAPI). This patch does that.
Attachment #8875553 - Flags: review?(continuation)
Comment on attachment 8875553 [details] [diff] [review] patch Review of attachment 8875553 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/base/nsFrameMessageManager.cpp @@ +2068,5 @@ > MOZ_ASSERT(mCalledInit); > if (aManager) { > + AutoJSAPI jsapi; > + jsapi.Init(); > + SameProcessCpowHolder cpows(jsapi.cx(), mCpows); Can you just call dom::RootingCx() here? Do we really need a fully set up AutoJSAPI?
Attachment #8875553 - Flags: review?(continuation) → review+
Pushed by wmccloskey@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/207b0675c786 Stop saving JSContext in nsSameProcessAsyncMessageBase (r=mccr8)
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla56
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: