Backed out changeset 38bcb731dba8 (bug 1131887)

This commit is contained in:
Wes Kocher 2015-02-13 13:25:42 -08:00
parent f53270b286
commit 981264f6fa
2 changed files with 29 additions and 1 deletions

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(f0966cb3-9171-4dc6-a446-37ea16611fb0)]
interface nsIXPConnect : nsISupports
{
%{ C++
@ -466,6 +466,11 @@ interface nsIXPConnect : nsISupports
in nsIXPCFunctionThisTranslator aTranslator);
void
reparentWrappedNativeIfFound(in JSContextPtr aJSContext,
in JSObjectPtr aScope,
in JSObjectPtr aNewParent,
in nsISupports aCOMObj);
void
rescueOrphansInScope(in JSContextPtr aJSContext, in JSObjectPtr aScope);
nsIXPConnectJSObjectHolder

View File

@ -690,6 +690,29 @@ nsXPConnect::GetWrappedNativeOfNativeObject(JSContext * aJSContext,
return NS_OK;
}
/* void reparentWrappedNativeIfFound (in JSContextPtr aJSContext,
* in JSObjectPtr aScope,
* in JSObjectPtr aNewParent,
* in nsISupports aCOMObj); */
NS_IMETHODIMP
nsXPConnect::ReparentWrappedNativeIfFound(JSContext * aJSContext,
JSObject * aScopeArg,
JSObject * aNewParentArg,
nsISupports *aCOMObj)
{
RootedObject aScope(aJSContext, aScopeArg);
RootedObject aNewParent(aJSContext, aNewParentArg);
XPCWrappedNativeScope* scope = ObjectScope(aScope);
XPCWrappedNativeScope* scope2 = ObjectScope(aNewParent);
if (!scope || !scope2)
return UnexpectedFailure(NS_ERROR_FAILURE);
RootedObject newParent(aJSContext, aNewParent);
return XPCWrappedNative::
ReparentWrapperIfFound(scope, scope2, newParent, aCOMObj);
}
static PLDHashOperator
MoveableWrapperFinder(PLDHashTable *table, PLDHashEntryHdr *hdr,
uint32_t number, void *arg)