Not part of seamonkey.

API change - changed nsXPTParamInfo from taking an InterfaceDirectoryEntry* (which really isn't part of the API I want to expose) to taking an nsIInterfaceInfo*, which is.
This commit is contained in:
mccabe%netscape.com 1999-03-10 06:06:19 +00:00
parent c2882d69b0
commit 5a43e6a2dd
10 changed files with 40 additions and 22 deletions

View File

@ -115,10 +115,10 @@ public:
// is associated with so that we can find the table this index indexes
// and then find the referenced XPTInterfaceDirectoryEntry so that we can
// find (or build) the appropriate nsIInterfaceInfo. Simple :)
nsIInterfaceInfo* GetInterface(XPTInterfaceDirectoryEntry *entry) const ;
nsIInterfaceInfo* GetInterface(nsIInterfaceInfo *info) const ;
// a *little* simpler than the above
const nsIID* GetInterfaceIID(XPTInterfaceDirectoryEntry *entry) const ;
const nsIID* GetInterfaceIID(nsIInterfaceInfo *info) const ;
private:
nsXPTParamInfo(); // no implementation

View File

@ -57,6 +57,13 @@ public:
#endif
private:
friend nsIInterfaceInfo*
nsXPTParamInfo::GetInterface(nsIInterfaceInfo *info) const;
friend const nsIID*
nsXPTParamInfo::GetInterfaceIID(nsIInterfaceInfo *info) const;
XPTInterfaceDirectoryEntry *getIDE() { return mEntry; };
XPTInterfaceDirectoryEntry* mEntry;
nsInterfaceInfo* mParent;

View File

@ -74,8 +74,6 @@ nsInterfaceInfoManager::GetAllocator(nsInterfaceInfoManager* iim /*= NULL*/)
static NS_DEFINE_IID(kAllocatorCID, NS_ALLOCATOR_CID);
static NS_DEFINE_IID(kIAllocatorIID, NS_IALLOCATOR_IID);
#define HACK_CACHE_SIZE 200
nsInterfaceInfoManager::nsInterfaceInfoManager()
: mAllocator(NULL)
{

View File

@ -55,9 +55,9 @@ public:
private:
friend nsIInterfaceInfo*
nsXPTParamInfo::GetInterface(XPTInterfaceDirectoryEntry *entry) const;
nsXPTParamInfo::GetInterface(nsIInterfaceInfo *info) const;
friend const nsIID*
nsXPTParamInfo::GetInterfaceIID(XPTInterfaceDirectoryEntry *entry) const;
nsXPTParamInfo::GetInterfaceIID(nsIInterfaceInfo *info) const;
void initInterfaceTables();

View File

@ -33,11 +33,13 @@
// Placeholder - this implementation just returns NULL.
nsIInterfaceInfo*
nsXPTParamInfo::GetInterface(XPTInterfaceDirectoryEntry *entry) const
nsXPTParamInfo::GetInterface(nsIInterfaceInfo *info) const
{
NS_PRECONDITION(GetType().TagPart() == nsXPTType::T_INTERFACE,
"not an interface");
XPTInterfaceDirectoryEntry *entry = ((nsInterfaceInfo *)info)->getIDE();
nsIInterfaceInfoManager* mgr;
if(!(mgr = nsInterfaceInfoManager::GetInterfaceInfoManager()))
return NULL;
@ -52,21 +54,23 @@ nsXPTParamInfo::GetInterface(XPTInterfaceDirectoryEntry *entry) const
char *interface_name;
interface_name = which_header->interface_directory[type.type.interface].name;
nsIInterfaceInfo *info;
nsresult nsr = mymgr->GetInfoForName(interface_name, &info);
nsIInterfaceInfo *ii;
nsresult nsr = mymgr->GetInfoForName(interface_name, &ii);
if (NS_IS_ERROR(nsr)) {
NS_RELEASE(mgr);
return NULL;
}
return info;
return ii;
}
const nsIID*
nsXPTParamInfo::GetInterfaceIID(XPTInterfaceDirectoryEntry *entry) const
nsXPTParamInfo::GetInterfaceIID(nsIInterfaceInfo *info) const
{
NS_PRECONDITION(GetType().TagPart() == nsXPTType::T_INTERFACE,
"not an interface");
XPTInterfaceDirectoryEntry *entry = ((nsInterfaceInfo *)info)->getIDE();
nsIInterfaceInfoManager* mgr;
if(!(mgr = nsInterfaceInfoManager::GetInterfaceInfoManager()))
return NULL;

View File

@ -115,10 +115,10 @@ public:
// is associated with so that we can find the table this index indexes
// and then find the referenced XPTInterfaceDirectoryEntry so that we can
// find (or build) the appropriate nsIInterfaceInfo. Simple :)
nsIInterfaceInfo* GetInterface(XPTInterfaceDirectoryEntry *entry) const ;
nsIInterfaceInfo* GetInterface(nsIInterfaceInfo *info) const ;
// a *little* simpler than the above
const nsIID* GetInterfaceIID(XPTInterfaceDirectoryEntry *entry) const ;
const nsIID* GetInterfaceIID(nsIInterfaceInfo *info) const ;
private:
nsXPTParamInfo(); // no implementation

View File

@ -57,6 +57,13 @@ public:
#endif
private:
friend nsIInterfaceInfo*
nsXPTParamInfo::GetInterface(nsIInterfaceInfo *info) const;
friend const nsIID*
nsXPTParamInfo::GetInterfaceIID(nsIInterfaceInfo *info) const;
XPTInterfaceDirectoryEntry *getIDE() { return mEntry; };
XPTInterfaceDirectoryEntry* mEntry;
nsInterfaceInfo* mParent;

View File

@ -74,8 +74,6 @@ nsInterfaceInfoManager::GetAllocator(nsInterfaceInfoManager* iim /*= NULL*/)
static NS_DEFINE_IID(kAllocatorCID, NS_ALLOCATOR_CID);
static NS_DEFINE_IID(kIAllocatorIID, NS_IALLOCATOR_IID);
#define HACK_CACHE_SIZE 200
nsInterfaceInfoManager::nsInterfaceInfoManager()
: mAllocator(NULL)
{

View File

@ -55,9 +55,9 @@ public:
private:
friend nsIInterfaceInfo*
nsXPTParamInfo::GetInterface(XPTInterfaceDirectoryEntry *entry) const;
nsXPTParamInfo::GetInterface(nsIInterfaceInfo *info) const;
friend const nsIID*
nsXPTParamInfo::GetInterfaceIID(XPTInterfaceDirectoryEntry *entry) const;
nsXPTParamInfo::GetInterfaceIID(nsIInterfaceInfo *info) const;
void initInterfaceTables();

View File

@ -33,11 +33,13 @@
// Placeholder - this implementation just returns NULL.
nsIInterfaceInfo*
nsXPTParamInfo::GetInterface(XPTInterfaceDirectoryEntry *entry) const
nsXPTParamInfo::GetInterface(nsIInterfaceInfo *info) const
{
NS_PRECONDITION(GetType().TagPart() == nsXPTType::T_INTERFACE,
"not an interface");
XPTInterfaceDirectoryEntry *entry = ((nsInterfaceInfo *)info)->getIDE();
nsIInterfaceInfoManager* mgr;
if(!(mgr = nsInterfaceInfoManager::GetInterfaceInfoManager()))
return NULL;
@ -52,21 +54,23 @@ nsXPTParamInfo::GetInterface(XPTInterfaceDirectoryEntry *entry) const
char *interface_name;
interface_name = which_header->interface_directory[type.type.interface].name;
nsIInterfaceInfo *info;
nsresult nsr = mymgr->GetInfoForName(interface_name, &info);
nsIInterfaceInfo *ii;
nsresult nsr = mymgr->GetInfoForName(interface_name, &ii);
if (NS_IS_ERROR(nsr)) {
NS_RELEASE(mgr);
return NULL;
}
return info;
return ii;
}
const nsIID*
nsXPTParamInfo::GetInterfaceIID(XPTInterfaceDirectoryEntry *entry) const
nsXPTParamInfo::GetInterfaceIID(nsIInterfaceInfo *info) const
{
NS_PRECONDITION(GetType().TagPart() == nsXPTType::T_INTERFACE,
"not an interface");
XPTInterfaceDirectoryEntry *entry = ((nsInterfaceInfo *)info)->getIDE();
nsIInterfaceInfoManager* mgr;
if(!(mgr = nsInterfaceInfoManager::GetInterfaceInfoManager()))
return NULL;