From b359dd631bc3b2aceea2391a08f2c02ef032e485 Mon Sep 17 00:00:00 2001 From: "dp%netscape.com" Date: Fri, 20 Aug 1999 23:06:47 +0000 Subject: [PATCH] PlatformFind() changed to return nsDll * instead of FactoryEntry. This is an internal api change. git-svn-id: svn://10.0.0.236/trunk@43884 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/xpcom/components/nsComponentManager.cpp | 16 ++++++++-------- mozilla/xpcom/components/nsComponentManager.h | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/mozilla/xpcom/components/nsComponentManager.cpp b/mozilla/xpcom/components/nsComponentManager.cpp index 877067d530e..4cfe3d49b1e 100644 --- a/mozilla/xpcom/components/nsComponentManager.cpp +++ b/mozilla/xpcom/components/nsComponentManager.cpp @@ -639,7 +639,7 @@ nsComponentManagerImpl::PlatformUnregister(const char *cidString, } nsresult -nsComponentManagerImpl::PlatformFind(const nsCID &aCID, nsFactoryEntry* *result) +nsComponentManagerImpl::PlatformFind(const nsCID &aCID, nsDll **aDll) { PR_ASSERT(mRegistry!=NULL); @@ -674,10 +674,8 @@ nsComponentManagerImpl::PlatformFind(const nsCID &aCID, nsFactoryEntry* *result) nsDll *dll = CreateCachedDll(library, lastModTime, fileSize); if (dll == NULL) return NS_ERROR_OUT_OF_MEMORY; - nsFactoryEntry *res = new nsFactoryEntry(aCID, dll); - if (res == NULL) return NS_ERROR_OUT_OF_MEMORY; - *result = res; + *aDll = dll; return NS_OK; } @@ -1147,14 +1145,16 @@ nsComponentManagerImpl::GetFactoryEntry(const nsCID &aClass, PRBool checkRegistr #ifdef USE_REGISTRY if (checkRegistry) { + nsDll *dll = NULL; PR_LOG(nsComponentManagerLog, PR_LOG_ALWAYS, ("\t\tnot found in factory cache. Looking in registry")); - nsresult rv = PlatformFind(aClass, &entry); - - // If we got one, cache it in our hashtable - if (NS_SUCCEEDED(rv)) + nsresult rv = PlatformFind(aClass, &dll); + if (NS_FAILED(rv)) return NULL; + entry = new nsFactoryEntry(aClass, dll); + if (entry != NULL) { + // If we got one, cache it in our hashtable PR_LOG(nsComponentManagerLog, PR_LOG_ALWAYS, ("\t\tfound in registry.")); mFactories->Put(&key, entry); diff --git a/mozilla/xpcom/components/nsComponentManager.h b/mozilla/xpcom/components/nsComponentManager.h index 13795454b2e..8440b26c4ac 100644 --- a/mozilla/xpcom/components/nsComponentManager.h +++ b/mozilla/xpcom/components/nsComponentManager.h @@ -181,7 +181,7 @@ protected: nsresult PlatformMarkNoComponents(nsDll *dll); nsresult PlatformRegister(const char *cidString, const char *className, const char *progID, nsDll *dll); nsresult PlatformUnregister(const char *cidString, const char *aLibrary); - nsresult PlatformFind(const nsCID &aCID, nsFactoryEntry* *result); + nsresult PlatformFind(const nsCID &aCID, nsDll* *aDll); nsresult PlatformProgIDToCLSID(const char *aProgID, nsCID *aClass); nsresult PlatformCLSIDToProgID(nsCID *aClass, char* *aClassName, char* *aProgID); void PlatformGetFileInfo(nsIRegistry::Key Key, PRUint32 *lastModifiedTime, PRUint32 *fileSize);