Bug 1131801 part 2. Get rid of the now-useless RescueOrphansInScope. r=peterv

This commit is contained in:
Boris Zbarsky 2015-02-13 14:34:53 -05:00
parent fec8cd0977
commit fb8f4cad8d
3 changed files with 1 additions and 46 deletions

View File

@ -1664,12 +1664,6 @@ nsHTMLDocument::Open(JSContext* cx,
}
}
}
nsIXPConnect *xpc = nsContentUtils::XPConnect();
rv = xpc->RescueOrphansInScope(cx, oldScope->GetGlobalJSObject());
if (rv.Failed()) {
return nullptr;
}
}
}

View File

@ -267,7 +267,7 @@ interface nsIXPCFunctionThisTranslator : nsISupports
{ 0xbd, 0xd6, 0x0, 0x0, 0x64, 0x65, 0x73, 0x74 } }
%}
[noscript, uuid(75975244-2cf0-43b1-b79a-9fd447fac06b)]
[noscript, uuid(6872bfd6-660b-4aa3-b54b-41ce1d2d69e3)]
interface nsIXPConnect : nsISupports
{
%{ C++
@ -465,9 +465,6 @@ interface nsIXPConnect : nsISupports
setFunctionThisTranslator(in nsIIDRef aIID,
in nsIXPCFunctionThisTranslator aTranslator);
void
rescueOrphansInScope(in JSContextPtr aJSContext, in JSObjectPtr aScope);
nsIXPConnectJSObjectHolder
getWrappedNativePrototype(in JSContextPtr aJSContext,
in JSObjectPtr aScope,

View File

@ -690,42 +690,6 @@ nsXPConnect::GetWrappedNativeOfNativeObject(JSContext * aJSContext,
return NS_OK;
}
static PLDHashOperator
MoveableWrapperFinder(PLDHashTable *table, PLDHashEntryHdr *hdr,
uint32_t number, void *arg)
{
nsTArray<nsRefPtr<XPCWrappedNative> > *array =
static_cast<nsTArray<nsRefPtr<XPCWrappedNative> > *>(arg);
XPCWrappedNative *wn = ((Native2WrappedNativeMap::Entry*)hdr)->value;
// If a wrapper is expired, then there are no references to it from JS, so
// we don't have to move it.
if (!wn->IsWrapperExpired())
array->AppendElement(wn);
return PL_DHASH_NEXT;
}
/* void rescueOrphansInScope(in JSContextPtr aJSContext, in JSObjectPtr aScope); */
NS_IMETHODIMP
nsXPConnect::RescueOrphansInScope(JSContext *aJSContext, JSObject *aScopeArg)
{
RootedObject aScope(aJSContext, aScopeArg);
XPCWrappedNativeScope *scope = ObjectScope(aScope);
if (!scope)
return UnexpectedFailure(NS_ERROR_FAILURE);
// First, look through the old scope and find all of the wrappers that we
// might need to rescue.
nsTArray<nsRefPtr<XPCWrappedNative> > wrappersToMove;
Native2WrappedNativeMap *map = scope->GetWrappedNativeMap();
wrappersToMove.SetCapacity(map->Count());
map->Enumerate(MoveableWrapperFinder, &wrappersToMove);
return NS_OK;
}
/* nsIStackFrame createStackFrameLocation (in uint32_t aLanguage, in string aFilename, in string aFunctionName, in int32_t aLineNumber, in nsIStackFrame aCaller); */
NS_IMETHODIMP
nsXPConnect::CreateStackFrameLocation(uint32_t aLanguage,