Closed
Bug 1477705
Opened 6 years ago
Closed 6 years ago
Stop using js::GetGlobalForObjectCrossCompartment in NPAPI code
Categories
(Core :: JavaScript Engine, enhancement)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla63
Tracking | Status | |
---|---|---|
firefox63 | --- | fixed |
People
(Reporter: jandem, Assigned: jandem)
References
Details
Attachments
(1 file)
(deleted),
patch
|
bzbarsky
:
review+
|
Details | Diff | Splinter Review |
There are two calls in _evaluate that need to go.
Assignee | ||
Comment 1•6 years ago
|
||
The first call here is equivalent to checking JS_IsGlobalObject and for the second one JS::CurrentGlobalOrNull(cx) preserves behavior because we wrapped the object into the current compartment.
This is written in a bit of a defensive style because I doubt we have great tests for this.
Attachment #8994190 -
Flags: review?(bzbarsky)
Comment 2•6 years ago
|
||
Comment on attachment 8994190 [details] [diff] [review]
Stop using js::GetGlobalForObjectCrossCompartment in NPAPI code
r=me. Might be worth adding a comment that the return value of nsNPObjWrapper::GetNewOrUsed is always in the compartment the passed-in JSContext is in. That would make it clear why expect the equality in the release assert to hold.
Attachment #8994190 -
Flags: review?(bzbarsky) → review+
Assignee | ||
Comment 3•6 years ago
|
||
(In reply to Boris Zbarsky [:bz] (no decent commit message means r-) from comment #2)
> r=me. Might be worth adding a comment that the return value of
> nsNPObjWrapper::GetNewOrUsed is always in the compartment the passed-in
> JSContext is in. That would make it clear why expect the equality in the
> release assert to hold.
OK, will add a comment to both the nsNPObjWrapper::GetNewOrUsed definition and near the MOZ_RELEASE_ASSERT.
Pushed by jandemooij@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/4cd287c3f96f
Stop using js::GetGlobalForObjectCrossCompartment in NPAPI code. r=bz
Comment 5•6 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
status-firefox63:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
You need to log in
before you can comment on or make changes to this bug.
Description
•