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 f78a123227
commit 35df7de8e1

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,