Closed Bug 1477989 Opened 6 years ago Closed 6 years ago

Stop using js::GetGlobalForObjectCrossCompartment in XBL code

Categories

(Core :: XBL, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla63
Tracking Status
firefox63 --- fixed

People

(Reporter: jandem, Assigned: jandem)

References

Details

Attachments

(4 files)

      No description provided.
GetOrCreateMapEntryForPrototype is the only caller where the object could be a CCW. However there cx and proto are same-compartment (GetOrCreateMapEntryForPrototype asserts this) so I changed that code to use JS::CurrentGlobalOrNull.
Attachment #8994588 - Flags: review?(bzbarsky)
This turned out to be easier than I expected and these patches are green on Try. But please review carefully.
Attachment #8994584 - Flags: review?(bzbarsky) → review+
Comment on attachment 8994586 [details] [diff] [review]
Part 2 - Use JS::GetNonCCWObjectGlobal in nsXBLBinding::DoInitJSClass

r=me
Attachment #8994586 - Flags: review?(bzbarsky) → review+
Comment on attachment 8994587 [details] [diff] [review]
Part 3 - Use JS::GetNonCCWObjectGlobal in nsXBLProtoImpl::InstallImplementation

r=me
Attachment #8994587 - Flags: review?(bzbarsky) → review+
Comment on attachment 8994588 [details] [diff] [review]
Part 4 - Use JS::GetNonCCWObjectGlobal in xpc::GetXBLScopeOrGlobal

r=me
Attachment #8994588 - Flags: review?(bzbarsky) → review+
Pushed by jandemooij@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/50a2d835fb1d
part 1 - Use JS::GetNonCCWObjectGlobal in nsXBLBinding::LookupMember. r=bz
https://hg.mozilla.org/integration/mozilla-inbound/rev/8cbf1712ac83
part 2 - Use JS::GetNonCCWObjectGlobal in nsXBLBinding::DoInitJSClass. r=bz
https://hg.mozilla.org/integration/mozilla-inbound/rev/96b793b536d0
part 3 - Use JS::GetNonCCWObjectGlobal in nsXBLProtoImpl::InstallImplementation. r=bz
https://hg.mozilla.org/integration/mozilla-inbound/rev/28325e1f71a4
part 4 - Use JS::GetNonCCWObjectGlobal in xpc::GetXBLScopeOrGlobal. r=bz
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: