From a8dbd5d65f260725c241170ae6556b727d51d02b Mon Sep 17 00:00:00 2001 From: Andrew McCreight Date: Fri, 5 Apr 2019 23:48:11 +0000 Subject: [PATCH] Bug 1541684, part 2 - Remove nsXPCWrappedJSClass::mIID. r=nika This is already stored on mInfo. Differential Revision: https://phabricator.services.mozilla.com/D26069 --HG-- extra : moz-landing-system : lando --- js/xpconnect/src/XPCWrappedJSClass.cpp | 9 ++++----- js/xpconnect/src/xpcprivate.h | 5 ++--- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/js/xpconnect/src/XPCWrappedJSClass.cpp b/js/xpconnect/src/XPCWrappedJSClass.cpp index 5c51d721058b..b21da68aa727 100644 --- a/js/xpconnect/src/XPCWrappedJSClass.cpp +++ b/js/xpconnect/src/XPCWrappedJSClass.cpp @@ -111,7 +111,7 @@ already_AddRefed nsXPCWrappedJSClass::GetNewOrUsed( const nsXPTInterfaceInfo* info = nsXPTInterfaceInfo::ByIID(aIID); if (info) { if (!info->IsBuiltinClass() && nsXPConnect::IsISupportsDescendant(info)) { - clasp = new nsXPCWrappedJSClass(aIID, info); + clasp = new nsXPCWrappedJSClass(info); if (!clasp->mDescriptors) { clasp = nullptr; } @@ -121,9 +121,8 @@ already_AddRefed nsXPCWrappedJSClass::GetNewOrUsed( return clasp.forget(); } -nsXPCWrappedJSClass::nsXPCWrappedJSClass(REFNSIID aIID, - const nsXPTInterfaceInfo* aInfo) - : mInfo(aInfo), mIID(aIID), mDescriptors(nullptr) { +nsXPCWrappedJSClass::nsXPCWrappedJSClass(const nsXPTInterfaceInfo* aInfo) + : mInfo(aInfo), mDescriptors(nullptr) { XPCJSRuntime::Get()->GetWrappedJSClassMap()->Add(this); uint16_t methodCount = mInfo->MethodCount(); @@ -1139,7 +1138,7 @@ nsXPCWrappedJSClass::DebugDump(int16_t depth) { XPC_LOG_INDENT(); const char* name = mInfo->Name(); XPC_LOG_ALWAYS(("interface name is %s", name)); - char* iid = mIID.ToString(); + char* iid = mInfo->IID().ToString(); XPC_LOG_ALWAYS(("IID number is %s", iid ? iid : "invalid")); if (iid) { free(iid); diff --git a/js/xpconnect/src/xpcprivate.h b/js/xpconnect/src/xpcprivate.h index a4e708116bca..641706653a09 100644 --- a/js/xpconnect/src/xpcprivate.h +++ b/js/xpconnect/src/xpcprivate.h @@ -1625,7 +1625,7 @@ class nsXPCWrappedJSClass final : public nsIXPCWrappedJSClass { public: static already_AddRefed GetNewOrUsed(REFNSIID aIID); - REFNSIID GetIID() const { return mIID; } + REFNSIID GetIID() const { return mInfo->IID(); } const nsXPTInterfaceInfo* GetInterfaceInfo() const { return mInfo; } const char* GetInterfaceName(); @@ -1654,7 +1654,7 @@ class nsXPCWrappedJSClass final : public nsIXPCWrappedJSClass { virtual ~nsXPCWrappedJSClass(); nsXPCWrappedJSClass() = delete; - nsXPCWrappedJSClass(REFNSIID aIID, const nsXPTInterfaceInfo* aInfo); + explicit nsXPCWrappedJSClass(const nsXPTInterfaceInfo* aInfo); bool IsReflectable(uint16_t i) const { return (bool)(mDescriptors[i / 32] & (1U << (i % 32))); @@ -1680,7 +1680,6 @@ class nsXPCWrappedJSClass final : public nsIXPCWrappedJSClass { private: const nsXPTInterfaceInfo* mInfo; - nsIID mIID; uint32_t* mDescriptors; };