Bug 1142717, part 2b - Rename obj to qiResult in InitTearOff. r=bholley

This commit is contained in:
Andrew McCreight 2015-03-18 11:36:03 -07:00
parent c797fd39b0
commit f471f5ff55

View File

@ -1166,7 +1166,7 @@ XPCWrappedNative::InitTearOff(XPCWrappedNativeTearOff* aTearOff,
// This is an nsRefPtr instead of an nsCOMPtr because it may not be the
// canonical nsISupports for this object.
nsRefPtr<nsISupports> obj;
nsRefPtr<nsISupports> qiResult;
// If the scriptable helper forbids us from reflecting additional
// interfaces, then don't even try the QI, just fail.
@ -1182,14 +1182,14 @@ XPCWrappedNative::InitTearOff(XPCWrappedNativeTearOff* aTearOff,
aTearOff->SetReserved();
if (NS_FAILED(identity->QueryInterface(*iid, getter_AddRefs(obj))) || !obj) {
if (NS_FAILED(identity->QueryInterface(*iid, getter_AddRefs(qiResult))) || !qiResult) {
aTearOff->SetInterface(nullptr);
return NS_ERROR_NO_INTERFACE;
}
// Guard against trying to build a tearoff for a shared nsIClassInfo.
if (iid->Equals(NS_GET_IID(nsIClassInfo))) {
nsCOMPtr<nsISupports> alternate_identity(do_QueryInterface(obj));
nsCOMPtr<nsISupports> alternate_identity(do_QueryInterface(qiResult));
if (alternate_identity.get() != identity) {
aTearOff->SetInterface(nullptr);
return NS_ERROR_NO_INTERFACE;
@ -1212,7 +1212,7 @@ XPCWrappedNative::InitTearOff(XPCWrappedNativeTearOff* aTearOff,
// The code in this block also does a check for the double wrapped
// nsIPropertyBag case.
nsCOMPtr<nsIXPConnectWrappedJS> wrappedJS(do_QueryInterface(obj));
nsCOMPtr<nsIXPConnectWrappedJS> wrappedJS(do_QueryInterface(qiResult));
if (wrappedJS) {
RootedObject jso(cx, wrappedJS->GetJSObject());
if (jso == mFlatJSObject) {
@ -1274,7 +1274,7 @@ XPCWrappedNative::InitTearOff(XPCWrappedNativeTearOff* aTearOff,
}
aTearOff->SetInterface(aInterface);
aTearOff->SetNative(obj.forget().take());
aTearOff->SetNative(qiResult.forget().take());
if (needJSObject && !InitTearOffJSObject(aTearOff))
return NS_ERROR_OUT_OF_MEMORY;