mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 761422, part 3 - get security wrappers before changing maps. r=bholley
This commit is contained in:
parent
40af3f379d
commit
e9759cb6ad
@ -1606,6 +1606,16 @@ XPCWrappedNative::ReparentWrapperIfFound(XPCCallContext& ccx,
|
||||
JS_SetPrivate(flat, nullptr);
|
||||
}
|
||||
|
||||
// Before proceeding, eagerly create any same-compartment security wrappers
|
||||
// that the object might have. This forces us to take the 'WithWrapper' path
|
||||
// while transplanting that handles this stuff correctly.
|
||||
{
|
||||
JSAutoEnterCompartment innerAC;
|
||||
if (!innerAC.enter(ccx, aOldScope->GetGlobalJSObject()) ||
|
||||
!wrapper->GetSameCompartmentSecurityWrapper(ccx))
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
{ // scoped lock
|
||||
Native2WrappedNativeMap* oldMap = aOldScope->GetWrappedNativeMap();
|
||||
Native2WrappedNativeMap* newMap = aNewScope->GetWrappedNativeMap();
|
||||
@ -1641,16 +1651,6 @@ XPCWrappedNative::ReparentWrapperIfFound(XPCCallContext& ccx,
|
||||
(void) newMap->Add(wrapper);
|
||||
}
|
||||
|
||||
// Before proceeding, eagerly create any same-compartment security wrappers
|
||||
// that the object might have. This forces us to take the 'WithWrapper' path
|
||||
// while transplanting that handles this stuff correctly.
|
||||
{
|
||||
JSAutoEnterCompartment innerAC;
|
||||
if (!innerAC.enter(ccx, aOldScope->GetGlobalJSObject()) ||
|
||||
!wrapper->GetSameCompartmentSecurityWrapper(ccx))
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
JSObject *ww = wrapper->GetWrapper();
|
||||
if (ww) {
|
||||
JSObject *newwrapper;
|
||||
|
Loading…
Reference in New Issue
Block a user