mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-02 01:48:05 +00:00
Bug 808608 - Remove unnecessary outparam. r=mrbkap
This commit is contained in:
parent
1824d3f494
commit
660ca5d5cf
@ -527,10 +527,7 @@ nsNodeUtils::CloneAndAdopt(nsINode *aNode, bool aClone, bool aDeep,
|
||||
if (aCx && wrapper) {
|
||||
nsIXPConnect *xpc = nsContentUtils::XPConnect();
|
||||
if (xpc) {
|
||||
nsCOMPtr<nsIXPConnectJSObjectHolder> oldWrapper;
|
||||
rv = xpc->ReparentWrappedNativeIfFound(aCx, wrapper, aNewScope, aNode,
|
||||
getter_AddRefs(oldWrapper));
|
||||
|
||||
rv = xpc->ReparentWrappedNativeIfFound(aCx, wrapper, aNewScope, aNode);
|
||||
if (NS_FAILED(rv)) {
|
||||
aNode->mNodeInfo.swap(nodeInfo);
|
||||
|
||||
|
@ -1515,11 +1515,9 @@ nsHTMLDocument::Open(const nsAString& aContentTypeOrUrl,
|
||||
nsCOMPtr<nsIScriptGlobalObject> newScope(do_QueryReferent(mScopeObject));
|
||||
if (oldScope && newScope != oldScope) {
|
||||
nsIXPConnect *xpc = nsContentUtils::XPConnect();
|
||||
nsCOMPtr<nsIXPConnectJSObjectHolder> ignored;
|
||||
rv = xpc->ReparentWrappedNativeIfFound(cx, oldScope->GetGlobalJSObject(),
|
||||
newScope->GetGlobalJSObject(),
|
||||
static_cast<nsINode*>(this),
|
||||
getter_AddRefs(ignored));
|
||||
static_cast<nsINode*>(this));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
rv = xpc->RescueOrphansInScope(cx, oldScope->GetGlobalJSObject());
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
@ -289,7 +289,7 @@ interface nsIXPCFunctionThisTranslator : nsISupports
|
||||
{ 0xbd, 0xd6, 0x0, 0x0, 0x64, 0x65, 0x73, 0x74 } }
|
||||
%}
|
||||
|
||||
[uuid(e28a33ce-dfe9-4816-ae20-0f1dc8077230)]
|
||||
[uuid(b551afea-f38c-46d4-bc93-f1e05aebfec2)]
|
||||
interface nsIXPConnect : nsISupports
|
||||
{
|
||||
%{ C++
|
||||
@ -519,7 +519,7 @@ interface nsIXPConnect : nsISupports
|
||||
setFunctionThisTranslator(in nsIIDRef aIID,
|
||||
in nsIXPCFunctionThisTranslator aTranslator);
|
||||
|
||||
nsIXPConnectJSObjectHolder
|
||||
void
|
||||
reparentWrappedNativeIfFound(in JSContextPtr aJSContext,
|
||||
in JSObjectPtr aScope,
|
||||
in JSObjectPtr aNewParent,
|
||||
|
@ -1423,8 +1423,7 @@ XPCWrappedNative::ReparentWrapperIfFound(XPCCallContext& ccx,
|
||||
XPCWrappedNativeScope* aOldScope,
|
||||
XPCWrappedNativeScope* aNewScope,
|
||||
JSObject* aNewParent,
|
||||
nsISupports* aCOMObj,
|
||||
XPCWrappedNative** aWrapper)
|
||||
nsISupports* aCOMObj)
|
||||
{
|
||||
XPCNativeInterface* iface =
|
||||
XPCNativeInterface::GetISupports(ccx);
|
||||
@ -1455,10 +1454,8 @@ XPCWrappedNative::ReparentWrapperIfFound(XPCCallContext& ccx,
|
||||
flat = wrapper->GetFlatJSObject();
|
||||
}
|
||||
|
||||
if (!flat) {
|
||||
*aWrapper = nullptr;
|
||||
if (!flat)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// ReparentWrapperIfFound is really only meant to be called from DOM code
|
||||
// which must happen only on the main thread. Bail if we're on some other
|
||||
@ -1657,9 +1654,6 @@ XPCWrappedNative::ReparentWrapperIfFound(XPCCallContext& ccx,
|
||||
}
|
||||
}
|
||||
|
||||
*aWrapper = nullptr;
|
||||
wrapper.swap(*aWrapper);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -1755,10 +1749,9 @@ XPCWrappedNative::RescueOrphans(XPCCallContext& ccx)
|
||||
// We've been orphaned. Find where our parent went, and follow it.
|
||||
JSObject *parentGhost = js::GetObjectParent(mFlatJSObject);
|
||||
JSObject *realParent = js::UnwrapObject(parentGhost);
|
||||
nsRefPtr<XPCWrappedNative> ignored;
|
||||
return ReparentWrapperIfFound(ccx, GetObjectScope(parentGhost),
|
||||
GetObjectScope(realParent),
|
||||
realParent, mIdentity, getter_AddRefs(ignored));
|
||||
realParent, mIdentity);
|
||||
}
|
||||
|
||||
#define IS_TEAROFF_CLASS(clazz) \
|
||||
|
@ -1462,13 +1462,15 @@ nsXPConnect::GetWrappedNativeOfNativeObject(JSContext * aJSContext,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* nsIXPConnectJSObjectHolder reparentWrappedNativeIfFound (in JSContextPtr aJSContext, in JSObjectPtr aScope, in JSObjectPtr aNewParent, in nsISupports aCOMObj); */
|
||||
/* void reparentWrappedNativeIfFound (in JSContextPtr aJSContext,
|
||||
* in JSObjectPtr aScope,
|
||||
* in JSObjectPtr aNewParent,
|
||||
* in nsISupports aCOMObj); */
|
||||
NS_IMETHODIMP
|
||||
nsXPConnect::ReparentWrappedNativeIfFound(JSContext * aJSContext,
|
||||
JSObject * aScope,
|
||||
JSObject * aNewParent,
|
||||
nsISupports *aCOMObj,
|
||||
nsIXPConnectJSObjectHolder **_retval)
|
||||
nsISupports *aCOMObj)
|
||||
{
|
||||
XPCCallContext ccx(NATIVE_CALLER, aJSContext);
|
||||
if (!ccx.IsValid())
|
||||
@ -1480,8 +1482,8 @@ nsXPConnect::ReparentWrappedNativeIfFound(JSContext * aJSContext,
|
||||
return UnexpectedFailure(NS_ERROR_FAILURE);
|
||||
|
||||
return XPCWrappedNative::
|
||||
ReparentWrapperIfFound(ccx, scope, scope2, aNewParent, aCOMObj,
|
||||
(XPCWrappedNative**) _retval);
|
||||
ReparentWrapperIfFound(ccx, scope, scope2, aNewParent,
|
||||
aCOMObj);
|
||||
}
|
||||
|
||||
static JSDHashOperator
|
||||
|
@ -2780,8 +2780,7 @@ public:
|
||||
XPCWrappedNativeScope* aOldScope,
|
||||
XPCWrappedNativeScope* aNewScope,
|
||||
JSObject* aNewParent,
|
||||
nsISupports* aCOMObj,
|
||||
XPCWrappedNative** aWrapper);
|
||||
nsISupports* aCOMObj);
|
||||
|
||||
bool IsOrphan();
|
||||
nsresult RescueOrphans(XPCCallContext& ccx);
|
||||
|
Loading…
Reference in New Issue
Block a user