diff --git a/mozilla/xpcom/components/nsComponentManager.cpp b/mozilla/xpcom/components/nsComponentManager.cpp index 1b2f2c1bbab..1d2b1d89ec9 100644 --- a/mozilla/xpcom/components/nsComponentManager.cpp +++ b/mozilla/xpcom/components/nsComponentManager.cpp @@ -2960,7 +2960,6 @@ nsComponentManagerImpl::AddLoaderType(const char *typeStr, int *aTypeIndex) typedef struct { const nsCID* cid; - const char* regName; nsIFactory* factory; } UnregisterConditions; @@ -2979,30 +2978,17 @@ DeleteFoundCIDs(PLDHashTable *aTable, nsFactoryEntry* factoryEntry = entry->mFactoryEntry; if (data->cid->Equals(factoryEntry->mCid) && - ((data->regName && !PL_strcasecmp(factoryEntry->mLocation, data->regName)) || - (data->factory && data->factory == factoryEntry->mFactory.get()))) + data->factory == factoryEntry->mFactory.get()) return PL_DHASH_REMOVE; return PL_DHASH_NEXT; } -void -nsComponentManagerImpl::DeleteContractIDEntriesByCID(const nsCID* aClass, const char*registryName) -{ - UnregisterConditions aData; - aData.cid = aClass; - aData.regName = registryName; - aData.factory = nsnull; - PL_DHashTableEnumerate(&mContractIDs, DeleteFoundCIDs, (void*)&aData); - -} - void nsComponentManagerImpl::DeleteContractIDEntriesByCID(const nsCID* aClass, nsIFactory* factory) { UnregisterConditions aData; aData.cid = aClass; - aData.regName = nsnull; aData.factory = factory; PL_DHashTableEnumerate(&mContractIDs, DeleteFoundCIDs, (void*)&aData); } @@ -3047,45 +3033,16 @@ nsresult nsComponentManagerImpl::UnregisterComponent(const nsCID &aClass, const char *registryName) { -#ifdef PR_LOGGING - if (PR_LOG_TEST(nsComponentManagerLog, PR_LOG_WARNING)) - { - char *buf = aClass.ToString(); - PR_LOG(nsComponentManagerLog, PR_LOG_WARNING, - ("nsComponentManager: UnregisterComponent(%s)", buf)); - if (buf) - PR_Free(buf); - } -#endif - - NS_ENSURE_ARG_POINTER(registryName); - nsFactoryEntry *old; - - // first delete all contract id entries that are registered with this cid. - DeleteContractIDEntriesByCID(&aClass, registryName); - - // next check to see if there is a CID registered - old = GetFactoryEntry(aClass); - if (old && old->mLocation && !PL_strcasecmp(old->mLocation, registryName)) - { - nsAutoMonitor mon(mMon); - PL_DHashTableOperate(&mFactories, &aClass, PL_DHASH_REMOVE); - } - - PR_LOG(nsComponentManagerLog, PR_LOG_WARNING, - ("nsComponentManager: Factory unregister(%s) succeeded.", registryName)); - - return NS_OK; + NS_ERROR("Don't call nsIComponentManagerObsolete.unregisterComponent"); + return NS_ERROR_NOT_IMPLEMENTED; } nsresult nsComponentManagerImpl::UnregisterComponentSpec(const nsCID &aClass, nsIFile *aLibrarySpec) { - nsXPIDLCString registryName; - nsresult rv = RegistryLocationForSpec(aLibrarySpec, getter_Copies(registryName)); - if (NS_FAILED(rv)) return rv; - return UnregisterComponent(aClass, registryName); + NS_ERROR("Don't call nsIComponentManagerObsolete.unregisterComponentSpec"); + return NS_ERROR_NOT_IMPLEMENTED; } // XXX Need to pass in aWhen and servicemanager diff --git a/mozilla/xpcom/components/nsComponentManager.h b/mozilla/xpcom/components/nsComponentManager.h index 0860677520e..88de6a0de05 100644 --- a/mozilla/xpcom/components/nsComponentManager.h +++ b/mozilla/xpcom/components/nsComponentManager.h @@ -187,7 +187,6 @@ public: nsresult HashContractID(const char *acontractID, PRUint32 aContractIDLen, nsFactoryEntry *fe_ptr); - void DeleteContractIDEntriesByCID(const nsCID* aClass, const char*registryName); void DeleteContractIDEntriesByCID(const nsCID* aClass, nsIFactory* factory); nsresult UnloadLibraries(nsIServiceManager *servmgr, PRInt32 when);