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
This commit is contained in:
Andrew McCreight 2019-04-05 23:48:11 +00:00
parent c1d8f269ef
commit a8dbd5d65f
2 changed files with 6 additions and 8 deletions

View File

@ -111,7 +111,7 @@ already_AddRefed<nsXPCWrappedJSClass> 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> 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);

View File

@ -1625,7 +1625,7 @@ class nsXPCWrappedJSClass final : public nsIXPCWrappedJSClass {
public:
static already_AddRefed<nsXPCWrappedJSClass> 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;
};