Bug 843231 - Move the nulling out of mPrototypeNoHelper from SetGlobal to RemoveWrappedNativeProtos. r=bz

The only call-site for both of these is JSD->nsXPConnect::InitClasses, so this
is equivalent. All this will go away soon anyhow when JSD goes away.
This commit is contained in:
Bobby Holley 2013-02-22 07:56:02 -08:00
parent 7901100c08
commit 0352ac2f47

View File

@ -294,9 +294,6 @@ XPCWrappedNativeScope::SetGlobal(JSContext *cx, JSObject* aGlobal)
// nsXPConnect::InitClassesWithNewWrappedGlobal.
mGlobalJSObject = aGlobal;
// Clear the no helper wrapper prototype object so that a new one
// gets created if needed.
mPrototypeNoHelper = nullptr;
}
XPCWrappedNativeScope::~XPCWrappedNativeScope()
@ -729,6 +726,10 @@ WNProtoRemover(JSDHashTable *table, JSDHashEntryHdr *hdr,
void
XPCWrappedNativeScope::RemoveWrappedNativeProtos()
{
// Clear the no helper wrapper prototype object so that a new one
// gets created if needed.
mPrototypeNoHelper = nullptr;
XPCAutoLock al(XPCJSRuntime::Get()->GetMapLock());
mWrappedNativeProtoMap->Enumerate(WNProtoRemover,