Bug 1480245, part 1 - Remove compatibility methods from nsXPTInterfaceInfo. r=nika
I left GetMethodInfo, GetConstant as they are still useful as separate methods.
Differential Revision:
https://phabricator.services.mozilla.com/D9638
--- a/dom/xbl/nsXBLPrototypeBinding.cpp
+++ b/dom/xbl/nsXBLPrototypeBinding.cpp
@@ -716,42 +716,34 @@ nsXBLPrototypeBinding::ConstructInterfac
// so that we don't have to convert from Unicode to ASCII and then back
char* token = nsCRT::strtok( str, ", ", &newStr );
while( token != nullptr ) {
// get the InterfaceInfo for the name
const nsXPTInterfaceInfo* iinfo = nsXPTInterfaceInfo::ByName(token);
if (iinfo) {
- // obtain an IID.
- const nsIID* iid = nullptr;
- iinfo->GetIIDShared(&iid);
-
- if (iid) {
- // We found a valid iid. Add it to our table.
- mInterfaceTable.Put(*iid, mBinding);
+ // Add the iid to our table.
+ mInterfaceTable.Put(iinfo->IID(), mBinding);
- // this block adds the parent interfaces of each interface
- // defined in the xbl definition (implements="nsI...")
- const nsXPTInterfaceInfo* parentInfo;
- // if it has a parent, add it to the table
- while (NS_SUCCEEDED(iinfo->GetParent(&parentInfo)) && parentInfo) {
- // get the iid
- parentInfo->GetIIDShared(&iid);
+ // this block adds the parent interfaces of each interface
+ // defined in the xbl definition (implements="nsI...")
+ const nsXPTInterfaceInfo* parentInfo;
+ // if it has a parent, add it to the table
+ while ((parentInfo = iinfo->GetParent())) {
+ // don't add nsISupports to the table
+ if (parentInfo->IID().Equals(NS_GET_IID(nsISupports))) {
+ break;
+ }
- // don't add nsISupports to the table
- if (!iid || iid->Equals(NS_GET_IID(nsISupports)))
- break;
+ // add the iid to the table
+ mInterfaceTable.Put(parentInfo->IID(), mBinding);
- // add the iid to the table
- mInterfaceTable.Put(*iid, mBinding);
-
- // look for the next parent
- iinfo = parentInfo;
- }
+ // look for the next parent
+ iinfo = parentInfo;
}
}
token = nsCRT::strtok( newStr, ", ", &newStr );
}
}
return NS_OK;
--- a/js/xpconnect/src/XPCInlines.h
+++ b/js/xpconnect/src/XPCInlines.h
@@ -233,25 +233,23 @@ XPCNativeMember::GetInterface() const
return reinterpret_cast<XPCNativeInterface*>(xpcNativeInterfaceStart);
}
/***************************************************************************/
inline const nsIID*
XPCNativeInterface::GetIID() const
{
- const nsIID* iid;
- return NS_SUCCEEDED(mInfo->GetIIDShared(&iid)) ? iid : nullptr;
+ return &mInfo->IID();
}
inline const char*
XPCNativeInterface::GetNameString() const
{
- const char* name;
- return NS_SUCCEEDED(mInfo->GetNameShared(&name)) ? name : nullptr;
+ return mInfo->Name();
}
inline XPCNativeMember*
XPCNativeInterface::FindMember(jsid name) const
{
const XPCNativeMember* member = mMembers;
for (int i = (int) mMemberCount; i > 0; i--, member++) {
if (member->GetName() == name) {
@@ -259,19 +257,17 @@ XPCNativeInterface::FindMember(jsid name
}
}
return nullptr;
}
inline bool
XPCNativeInterface::HasAncestor(const nsIID* iid) const
{
- bool found = false;
- mInfo->HasAncestor(iid, &found);
- return found;
+ return mInfo->HasAncestor(*iid);
}
/* static */
inline size_t
XPCNativeInterface::OffsetOfMembers()
{
return offsetof(XPCNativeInterface, mMembers);
}
--- a/js/xpconnect/src/XPCJSID.cpp
+++ b/js/xpconnect/src/XPCJSID.cpp
@@ -304,34 +304,31 @@ nsJSIID::nsJSIID(const nsXPTInterfaceInf
}
nsJSIID::~nsJSIID() {}
// If mInfo is present we use it and ignore mDetails, else we use mDetails.
NS_IMETHODIMP nsJSIID::GetName(char * *aName)
{
- return mInfo->GetName(aName);
+ *aName = moz_xstrdup(mInfo->Name());
+ return NS_OK;
}
NS_IMETHODIMP nsJSIID::GetNumber(char * *aNumber)
{
char str[NSID_LENGTH];
- const nsIID* id;
- mInfo->GetIIDShared(&id);
- id->ToProvidedString(str);
+ mInfo->IID().ToProvidedString(str);
*aNumber = (char*) moz_xmemdup(str, NSID_LENGTH);
return NS_OK;
}
NS_IMETHODIMP_(const nsID*) nsJSIID::GetID()
{
- const nsIID* id;
- mInfo->GetIIDShared(&id);
- return id;
+ return &mInfo->IID();
}
NS_IMETHODIMP nsJSIID::GetValid(bool* aValid)
{
*aValid = true;
return NS_OK;
}
@@ -341,28 +338,29 @@ NS_IMETHODIMP nsJSIID::Equals(nsIJSID* o
return NS_ERROR_NULL_POINTER;
}
if (!other) {
*_retval = false;
return NS_OK;
}
- mInfo->IsIID(other->GetID(), _retval);
+ *_retval = mInfo->IID() == *other->GetID();
return NS_OK;
}
NS_IMETHODIMP nsJSIID::Initialize(const char* idString)
{
return NS_ERROR_FAILURE;
}
NS_IMETHODIMP nsJSIID::ToString(char** _retval)
{
- return mInfo->GetName(_retval);
+ *_retval = moz_xstrdup(mInfo->Name());
+ return NS_OK;
}
// static
already_AddRefed<nsJSIID>
nsJSIID::NewID(const nsXPTInterfaceInfo* aInfo)
{
if (!aInfo) {
NS_ERROR("no info");
@@ -532,18 +530,17 @@ nsJSIID::HasInstance(nsIXPConnectWrapped
if (val.isPrimitive()) {
return NS_OK;
}
// we have a JSObject
RootedObject obj(cx, &val.toObject());
- const nsIID* iid;
- mInfo->GetIIDShared(&iid);
+ const nsIID* iid = &mInfo->IID();
return xpc::HasInstance(cx, obj, iid, bp);
}
/***************************************************************************/
NS_IMPL_QUERY_INTERFACE_CI(nsJSCID,
nsIJSID,
nsIJSCID,
--- a/js/xpconnect/src/XPCWrappedJS.cpp
+++ b/js/xpconnect/src/XPCWrappedJS.cpp
@@ -611,20 +611,19 @@ nsXPCWrappedJS::Find(REFNSIID aIID)
// check if asking for an interface that some wrapper in the chain inherits from
nsXPCWrappedJS*
nsXPCWrappedJS::FindInherited(REFNSIID aIID)
{
MOZ_ASSERT(!aIID.Equals(NS_GET_IID(nsISupports)), "bad call sequence");
for (nsXPCWrappedJS* cur = mRoot; cur; cur = cur->mNext) {
- bool found;
- if (NS_SUCCEEDED(cur->GetClass()->GetInterfaceInfo()->
- HasAncestor(&aIID, &found)) && found)
+ if (cur->GetClass()->GetInterfaceInfo()->HasAncestor(aIID)) {
return cur;
+ }
}
return nullptr;
}
NS_IMETHODIMP
nsXPCWrappedJS::GetInterfaceInfo(const nsXPTInterfaceInfo** infoResult)
{
@@ -746,22 +745,18 @@ NS_IMETHODIMP
nsXPCWrappedJS::DebugDump(int16_t depth)
{
#ifdef DEBUG
XPC_LOG_ALWAYS(("nsXPCWrappedJS @ %p with mRefCnt = %" PRIuPTR, this, mRefCnt.get()));
XPC_LOG_INDENT();
XPC_LOG_ALWAYS(("%s wrapper around JSObject @ %p", \
IsRootWrapper() ? "ROOT":"non-root", mJSObj.get()));
- char* name;
- GetClass()->GetInterfaceInfo()->GetName(&name);
+ const char* name = GetClass()->GetInterfaceInfo()->Name();
XPC_LOG_ALWAYS(("interface name is %s", name));
- if (name) {
- free(name);
- }
char * iid = GetClass()->GetIID().ToString();
XPC_LOG_ALWAYS(("IID number is %s", iid ? iid : "invalid"));
if (iid) {
free(iid);
}
XPC_LOG_ALWAYS(("nsXPCWrappedJSClass @ %p", mClass.get()));
if (!IsRootWrapper()) {
--- a/js/xpconnect/src/XPCWrappedJSClass.cpp
+++ b/js/xpconnect/src/XPCWrappedJSClass.cpp
@@ -111,19 +111,19 @@ nsXPCWrappedJSClass::GetNewOrUsed(JSCont
{
XPCJSRuntime* xpcrt = nsXPConnect::GetRuntimeInstance();
IID2WrappedJSClassMap* map = xpcrt->GetWrappedJSClassMap();
RefPtr<nsXPCWrappedJSClass> clasp = map->Find(aIID);
if (!clasp) {
const nsXPTInterfaceInfo* info = nsXPTInterfaceInfo::ByIID(aIID);
if (info) {
- bool canScript, isBuiltin;
- if (NS_SUCCEEDED(info->IsScriptable(&canScript)) && (canScript || allowNonScriptable) &&
- NS_SUCCEEDED(info->IsBuiltinClass(&isBuiltin)) && !isBuiltin &&
+ bool canScript = info->IsScriptable();
+ bool isBuiltin = info->IsBuiltinClass();
+ if ((canScript || allowNonScriptable) && !isBuiltin &&
nsXPConnect::IsISupportsDescendant(info))
{
clasp = new nsXPCWrappedJSClass(cx, aIID, info);
if (!clasp->mDescriptors) {
clasp = nullptr;
}
}
}
@@ -136,41 +136,39 @@ nsXPCWrappedJSClass::nsXPCWrappedJSClass
: mRuntime(nsXPConnect::GetRuntimeInstance()),
mInfo(aInfo),
mName(nullptr),
mIID(aIID),
mDescriptors(nullptr)
{
mRuntime->GetWrappedJSClassMap()->Add(this);
- uint16_t methodCount;
- if (NS_SUCCEEDED(mInfo->GetMethodCount(&methodCount))) {
- if (methodCount) {
- int wordCount = (methodCount/32)+1;
- if (nullptr != (mDescriptors = new uint32_t[wordCount])) {
- int i;
- // init flags to 0;
- for (i = wordCount-1; i >= 0; i--) {
- mDescriptors[i] = 0;
- }
+ uint16_t methodCount = mInfo->MethodCount();
+ if (methodCount) {
+ int wordCount = (methodCount/32)+1;
+ if (nullptr != (mDescriptors = new uint32_t[wordCount])) {
+ int i;
+ // init flags to 0;
+ for (i = wordCount-1; i >= 0; i--) {
+ mDescriptors[i] = 0;
+ }
- for (i = 0; i < methodCount; i++) {
- const nsXPTMethodInfo* info;
- if (NS_SUCCEEDED(mInfo->GetMethodInfo(i, &info))) {
- SetReflectable(i, XPCConvert::IsMethodReflectable(*info));
- } else {
- delete [] mDescriptors;
- mDescriptors = nullptr;
- break;
- }
+ for (i = 0; i < methodCount; i++) {
+ const nsXPTMethodInfo* info;
+ if (NS_SUCCEEDED(mInfo->GetMethodInfo(i, &info))) {
+ SetReflectable(i, XPCConvert::IsMethodReflectable(*info));
+ } else {
+ delete [] mDescriptors;
+ mDescriptors = nullptr;
+ break;
}
}
- } else {
- mDescriptors = &zero_methods_descriptor;
}
+ } else {
+ mDescriptors = &zero_methods_descriptor;
}
}
nsXPCWrappedJSClass::~nsXPCWrappedJSClass()
{
if (mDescriptors && mDescriptors != &zero_methods_descriptor) {
delete [] mDescriptors;
}
@@ -1076,34 +1074,29 @@ nsXPCWrappedJSClass::CallMethod(nsXPCWra
if (!(info->IsSetter() || info->IsGetter())) {
// We get fval before allocating the stack to avoid gc badness that can
// happen if the GetProperty call leaves our request and the gc runs
// while the stack we allocate contains garbage.
// If the interface is marked as a [function] then we will assume that
// our JSObject is a function and not an object with a named method.
- bool isFunction;
- if (NS_FAILED(mInfo->IsFunction(&isFunction))) {
- goto pre_call_clean_up;
- }
-
// In the xpidl [function] case we are making sure now that the
// JSObject is callable. If it is *not* callable then we silently
// fallback to looking up the named property...
// (because jst says he thinks this fallback is 'The Right Thing'.)
//
// In the normal (non-function) case we just lookup the property by
// name and as long as the object has such a named property we go ahead
// and try to make the call. If it turns out the named property is not
// a callable object then the JS engine will throw an error and we'll
// pass this along to the caller as an exception/result code.
fval = ObjectValue(*obj);
- if (!isFunction || JS_TypeOfValue(ccx, fval) != JSTYPE_FUNCTION) {
+ if (!mInfo->IsFunction() || JS_TypeOfValue(ccx, fval) != JSTYPE_FUNCTION) {
if (!JS_GetPropertyById(cx, obj, id, &fval)) {
goto pre_call_clean_up;
}
// XXX We really want to factor out the error reporting better and
// specifically report the failure to find a function with this name.
// This is what we do below if the property is found but is not a
// function. We just need to factor better so we can get to that
// reporting path from here.
@@ -1334,17 +1327,17 @@ pre_call_clean_up:
return retval;
}
const char*
nsXPCWrappedJSClass::GetInterfaceName()
{
if (!mName) {
- mInfo->GetName(&mName);
+ mName = moz_xstrdup(mInfo->Name());
}
return mName;
}
static const JSClass XPCOutParamClass = {
"XPCOutParam",
0,
JS_NULL_CLASS_OPS
@@ -1365,39 +1358,31 @@ xpc::NewOutObject(JSContext* cx)
NS_IMETHODIMP
nsXPCWrappedJSClass::DebugDump(int16_t depth)
{
#ifdef DEBUG
depth-- ;
XPC_LOG_ALWAYS(("nsXPCWrappedJSClass @ %p with mRefCnt = %" PRIuPTR, this, mRefCnt.get()));
XPC_LOG_INDENT();
- char* name;
- mInfo->GetName(&name);
+ const char* name = mInfo->Name();
XPC_LOG_ALWAYS(("interface name is %s", name));
- if (name) {
- free(name);
- }
char * iid = mIID.ToString();
XPC_LOG_ALWAYS(("IID number is %s", iid ? iid : "invalid"));
if (iid) {
free(iid);
}
XPC_LOG_ALWAYS(("InterfaceInfo @ %p", mInfo));
uint16_t methodCount = 0;
if (depth) {
- uint16_t i;
- const nsXPTInterfaceInfo* parent;
XPC_LOG_INDENT();
- mInfo->GetParent(&parent);
- XPC_LOG_ALWAYS(("parent @ %p", parent));
- mInfo->GetMethodCount(&methodCount);
+ XPC_LOG_ALWAYS(("parent @ %p", mInfo->GetParent()));
+ methodCount = mInfo->MethodCount();
XPC_LOG_ALWAYS(("MethodCount = %d", methodCount));
- mInfo->GetConstantCount(&i);
- XPC_LOG_ALWAYS(("ConstantCount = %d", i));
+ XPC_LOG_ALWAYS(("ConstantCount = %d", mInfo->ConstantCount()));
XPC_LOG_OUTDENT();
}
XPC_LOG_ALWAYS(("mRuntime @ %p", mRuntime));
XPC_LOG_ALWAYS(("mDescriptors @ %p count = %d", mDescriptors, methodCount));
if (depth && mDescriptors && methodCount) {
depth--;
XPC_LOG_INDENT();
for (uint16_t i = 0; i < methodCount; i++) {
--- a/js/xpconnect/src/XPCWrappedNative.cpp
+++ b/js/xpconnect/src/XPCWrappedNative.cpp
@@ -1886,36 +1886,33 @@ static void DEBUG_CheckClassInfoClaims(X
nsISupports* obj = wrapper->GetIdentityObject();
XPCNativeSet* set = wrapper->GetSet();
uint16_t count = set->GetInterfaceCount();
for (uint16_t i = 0; i < count; i++) {
nsIClassInfo* clsInfo = wrapper->GetClassInfo();
XPCNativeInterface* iface = set->GetInterfaceAt(i);
const nsXPTInterfaceInfo* info = iface->GetInterfaceInfo();
- const nsIID* iid;
nsISupports* ptr;
- info->GetIIDShared(&iid);
- nsresult rv = obj->QueryInterface(*iid, (void**)&ptr);
+ nsresult rv = obj->QueryInterface(info->IID(), (void**)&ptr);
if (NS_SUCCEEDED(rv)) {
NS_RELEASE(ptr);
continue;
}
if (rv == NS_ERROR_OUT_OF_MEMORY) {
continue;
}
// Houston, We have a problem...
char* className = nullptr;
char* contractID = nullptr;
- const char* interfaceName;
+ const char* interfaceName = info->Name();
- info->GetNameShared(&interfaceName);
clsInfo->GetContractID(&contractID);
if (wrapper->GetScriptable()) {
wrapper->GetScriptable()->GetClassName(&className);
}
printf("\n!!! Object's nsIClassInfo lies about its interfaces!!!\n"
" classname: %s \n"
" contractid: %s \n"
--- a/js/xpconnect/src/XPCWrappedNativeInfo.cpp
+++ b/js/xpconnect/src/XPCWrappedNativeInfo.cpp
@@ -163,29 +163,24 @@ XPCNativeInterface::GetNewOrUsed(const n
}
// static
already_AddRefed<XPCNativeInterface>
XPCNativeInterface::GetNewOrUsed(const nsXPTInterfaceInfo* info)
{
RefPtr<XPCNativeInterface> iface;
- const nsIID* iid;
- if (NS_FAILED(info->GetIIDShared(&iid)) || !iid) {
- return nullptr;
- }
-
XPCJSRuntime* rt = XPCJSRuntime::Get();
IID2NativeInterfaceMap* map = rt->GetIID2NativeInterfaceMap();
if (!map) {
return nullptr;
}
- iface = map->Find(*iid);
+ iface = map->Find(info->IID());
if (iface) {
return iface.forget();
}
iface = NewInstance(info);
if (!iface) {
return nullptr;
@@ -225,62 +220,54 @@ XPCNativeInterface::NewInstance(const ns
AutoJSContext cx;
static const uint16_t MAX_LOCAL_MEMBER_COUNT = 16;
XPCNativeMember local_members[MAX_LOCAL_MEMBER_COUNT];
RefPtr<XPCNativeInterface> obj;
XPCNativeMember* members = nullptr;
int i;
bool failed = false;
- uint16_t constCount;
- uint16_t methodCount;
uint16_t totalCount;
uint16_t realTotalCount = 0;
XPCNativeMember* cur;
RootedString str(cx);
RootedId interfaceName(cx);
// XXX Investigate lazy init? This is a problem given the
// 'placement new' scheme - we need to at least know how big to make
// the object. We might do a scan of methods to determine needed size,
// then make our object, but avoid init'ing *any* members until asked?
// Find out how often we create these objects w/o really looking at
// (or using) the members.
- bool canScript;
- if (NS_FAILED(aInfo->IsScriptable(&canScript)) || !canScript) {
+ if (!aInfo->IsScriptable()) {
return nullptr;
}
- bool mainProcessScriptableOnly;
- if (NS_FAILED(aInfo->IsMainProcessScriptableOnly(&mainProcessScriptableOnly))) {
- return nullptr;
- }
+ bool mainProcessScriptableOnly = aInfo->IsMainProcessScriptableOnly();
if (mainProcessScriptableOnly && !XRE_IsParentProcess()) {
nsCOMPtr<nsIConsoleService> console(do_GetService(NS_CONSOLESERVICE_CONTRACTID));
if (console) {
- const char* intfNameChars;
- aInfo->GetNameShared(&intfNameChars);
+ const char* intfNameChars = aInfo->Name();
nsPrintfCString errorMsg("Use of %s in content process is deprecated.", intfNameChars);
nsAutoString filename;
uint32_t lineno = 0, column = 0;
nsJSUtils::GetCallingLocation(cx, filename, &lineno, &column);
nsCOMPtr<nsIScriptError> error(do_CreateInstance(NS_SCRIPTERROR_CONTRACTID));
error->Init(NS_ConvertUTF8toUTF16(errorMsg),
filename, EmptyString(),
lineno, column, nsIScriptError::warningFlag, "chrome javascript",
false /* from private window */);
console->LogMessage(error);
}
}
- if (NS_FAILED(aInfo->GetMethodCount(&methodCount)) ||
- NS_FAILED(aInfo->GetConstantCount(&constCount)))
- return nullptr;
+ uint16_t methodCount = aInfo->MethodCount();
+ uint16_t constCount = aInfo->ConstantCount();
// If the interface does not have nsISupports in its inheritance chain
// then we know we can't reflect its methods. However, some interfaces that
// are used just to reflect constants are declared this way. We need to
// go ahead and build the thing. But, we'll ignore whatever methods it may
// have.
if (!nsXPConnect::IsISupportsDescendant(aInfo)) {
methodCount = 0;
@@ -386,18 +373,18 @@ XPCNativeInterface::NewInstance(const ns
cur->SetName(name);
cur->SetConstant(i);
cur->SetIndexInInterface(realTotalCount);
++realTotalCount;
}
}
if (!failed) {
- const char* bytes;
- if (NS_FAILED(aInfo->GetNameShared(&bytes)) || !bytes ||
+ const char* bytes = aInfo->Name();
+ if (nullptr == bytes ||
nullptr == (str = JS_AtomizeAndPinString(cx, bytes))) {
failed = true;
}
interfaceName = INTERNED_STRING_TO_JSID(cx, str);
}
if (!failed) {
// Use placement new to create an object with the right amount of space
--- a/xpcom/reflect/xptinfo/xptinfo.cpp
+++ b/xpcom/reflect/xptinfo/xptinfo.cpp
@@ -57,63 +57,16 @@ nsXPTInterfaceInfo::Method(uint16_t aInd
return pi->Method(aIndex);
}
aIndex -= pi->MethodCount();
}
return xpt::detail::GetMethod(mMethods + aIndex);
}
-
-////////////////////////////////////////////////
-// nsIInterfaceInfo backcompat implementation //
-////////////////////////////////////////////////
-
-nsresult
-nsXPTInterfaceInfo::GetName(char** aName) const
-{
- *aName = moz_xstrdup(Name());
- return NS_OK;
-}
-
-nsresult
-nsXPTInterfaceInfo::IsScriptable(bool* aRes) const
-{
- *aRes = IsScriptable();
- return NS_OK;
-}
-
-nsresult
-nsXPTInterfaceInfo::IsBuiltinClass(bool* aRes) const
-{
- *aRes = IsBuiltinClass();
- return NS_OK;
-}
-
-nsresult
-nsXPTInterfaceInfo::GetParent(const nsXPTInterfaceInfo** aParent) const
-{
- *aParent = GetParent();
- return NS_OK;
-}
-
-nsresult
-nsXPTInterfaceInfo::GetMethodCount(uint16_t* aMethodCount) const
-{
- *aMethodCount = MethodCount();
- return NS_OK;
-}
-
-nsresult
-nsXPTInterfaceInfo::GetConstantCount(uint16_t* aConstantCount) const
-{
- *aConstantCount = ConstantCount();
- return NS_OK;
-}
-
nsresult
nsXPTInterfaceInfo::GetMethodInfo(uint16_t aIndex, const nsXPTMethodInfo** aInfo) const
{
*aInfo = aIndex < MethodCount() ? &Method(aIndex) : nullptr;
return *aInfo ? NS_OK : NS_ERROR_FAILURE;
}
nsresult
@@ -124,58 +77,16 @@ nsXPTInterfaceInfo::GetConstant(uint16_t
if (aIndex < ConstantCount()) {
aConstant.set(Constant(aIndex).JSValue());
*aName = moz_xstrdup(Constant(aIndex).Name());
return NS_OK;
}
return NS_ERROR_FAILURE;
}
-nsresult
-nsXPTInterfaceInfo::IsIID(const nsIID* aIID, bool* aIs) const
-{
- *aIs = mIID == *aIID;
- return NS_OK;
-}
-
-nsresult
-nsXPTInterfaceInfo::GetNameShared(const char** aName) const
-{
- *aName = Name();
- return NS_OK;
-}
-
-nsresult
-nsXPTInterfaceInfo::GetIIDShared(const nsIID** aIID) const
-{
- *aIID = &IID();
- return NS_OK;
-}
-
-nsresult
-nsXPTInterfaceInfo::IsFunction(bool* aRetval) const
-{
- *aRetval = IsFunction();
- return NS_OK;
-}
-
-nsresult
-nsXPTInterfaceInfo::HasAncestor(const nsIID* aIID, bool* aRetval) const
-{
- *aRetval = HasAncestor(*aIID);
- return NS_OK;
-}
-
-nsresult
-nsXPTInterfaceInfo::IsMainProcessScriptableOnly(bool* aRetval) const
-{
- *aRetval = IsMainProcessScriptableOnly();
- return NS_OK;
-}
-
////////////////////////////////////
// nsXPTMethodInfo symbol helpers //
////////////////////////////////////
void
nsXPTMethodInfo::GetSymbolDescription(JSContext* aCx, nsACString& aID) const
{
JS::RootedSymbol symbol(aCx, GetSymbol(aCx));
--- a/xpcom/reflect/xptinfo/xptinfo.h
+++ b/xpcom/reflect/xptinfo/xptinfo.h
@@ -96,37 +96,20 @@ struct nsXPTInterfaceInfo
bool HasAncestor(const nsIID& aIID) const;
// Get methods & constants
uint16_t ConstantCount() const { return mNumConsts; }
const nsXPTConstantInfo& Constant(uint16_t aIndex) const;
uint16_t MethodCount() const { return mNumMethods; }
const nsXPTMethodInfo& Method(uint16_t aIndex) const;
-
- ////////////////////////////////////////////////////////////
- // nsIInterfaceInfo backwards compatibility (bug 1480245) //
- ////////////////////////////////////////////////////////////
-
- nsresult GetName(char** aName) const;
- nsresult IsScriptable(bool* aRes) const;
- nsresult IsBuiltinClass(bool* aRes) const;
- nsresult GetParent(const nsXPTInterfaceInfo** aParent) const;
- nsresult GetMethodCount(uint16_t* aMethodCount) const;
- nsresult GetConstantCount(uint16_t* aConstantCount) const;
nsresult GetMethodInfo(uint16_t aIndex, const nsXPTMethodInfo** aInfo) const;
nsresult GetConstant(uint16_t aIndex,
JS::MutableHandleValue constant,
char** aName) const;
- nsresult IsIID(const nsIID* aIID, bool* aIs) const;
- nsresult GetNameShared(const char** aName) const;
- nsresult GetIIDShared(const nsIID** aIID) const;
- nsresult IsFunction(bool* aRetval) const;
- nsresult HasAncestor(const nsIID* aIID, bool* aRetval) const;
- nsresult IsMainProcessScriptableOnly(bool* aRetval) const;
bool EnsureResolved() const { return true; } // XXX: Remove (bug 1480245)
////////////////////////////////////////////////////////////////
// Ensure these fields are in the same order as xptcodegen.py //
////////////////////////////////////////////////////////////////
nsID mIID;