Backed out changeset: 8b5a38ba459a
authorSerge Gautherie <sgautherie.bz@free.fr>
Sat, 20 Dec 2008 02:56:04 +0100
changeset 22973 efe3c6f76bca38763cebf51a26460b6ab2bc4195
parent 22970 8b5a38ba459a9f2e3ead5def89d09492fdacc94d
child 22974 e45938aee3095322c89de66acdb8c08c9ecfa9ef
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone1.9.2a1pre
Backed out changeset: 8b5a38ba459a
xpcom/components/nsComponentManager.cpp
xpcom/components/nsComponentManager.h
--- a/xpcom/components/nsComponentManager.cpp
+++ b/xpcom/components/nsComponentManager.cpp
@@ -1293,17 +1293,17 @@ out:
 nsresult
 nsComponentManagerImpl::HashContractID(const char *aContractID,
                                        PRUint32 aContractIDLen,
                                        nsFactoryEntry *fe)
 {
     if(!aContractID || !aContractIDLen)
         return NS_ERROR_NULL_POINTER;
 
-    NS_ASSERTION(PR_GetMonitorEntryCount(mMon), "called from outside mMon");
+    nsAutoMonitor mon(mMon);
 
     nsContractIDTableEntry* contractIDTableEntry =
         static_cast<nsContractIDTableEntry*>
                    (PL_DHashTableOperate(&mContractIDs, aContractID,
                                             PL_DHASH_ADD));
     if (!contractIDTableEntry)
         return NS_ERROR_OUT_OF_MEMORY;
 
--- a/xpcom/components/nsComponentManager.h
+++ b/xpcom/components/nsComponentManager.h
@@ -208,19 +208,16 @@ public:
     nsresult FindFactory(const char *contractID, PRUint32 aContractIDLen, nsIFactory **aFactory) ;
     nsresult LoadFactory(nsFactoryEntry *aEntry, nsIFactory **aFactory);
 
     nsFactoryEntry *GetFactoryEntry(const char *aContractID,
                                     PRUint32 aContractIDLen);
     nsFactoryEntry *GetFactoryEntry(const nsCID &aClass);
 
     nsresult SyncComponentsInDir(PRInt32 when, nsIFile *dirSpec);
-
-    // NOTE: HashContractID operates on the hash table with ContractIDs,
-    // for thread-safety it should only be invoked from inside mMon.
     nsresult HashContractID(const char *acontractID, PRUint32 aContractIDLen,
                             nsFactoryEntry *fe_ptr);
 
     void DeleteContractIDEntriesByCID(const nsCID* aClass, nsIFactory* factory);
     nsresult AutoRegisterImpl(nsIFile*                  inDirSpec,
                               nsCOMArray<nsILocalFile> &aLeftovers,
                               nsTArray<DeferredModule> &aDeferred);
     nsresult AutoRegisterDirectory(nsIFile*                  aComponentFile,