Trying to fix random orange, backing out Bug 463289,
authorOlli Pettay <Olli.Pettay@helsinki.fi>
Wed, 03 Dec 2008 15:26:59 +0200
changeset 22234 5d12d7b9ddb6af8ac807bbcdec5ea8e69d78c6cb
parent 22233 2f727f142360bd3d304885314bacd3a7075c11a5
child 22235 0f1b8ab7cd8e9568d6dbf71c425102a0f559823d
push idunknown
push userunknown
push dateunknown
bugs463289
milestone1.9.2a1pre
Trying to fix random orange, backing out Bug 463289,
xpcom/components/nsNativeComponentLoader.cpp
--- a/xpcom/components/nsNativeComponentLoader.cpp
+++ b/xpcom/components/nsNativeComponentLoader.cpp
@@ -55,22 +55,20 @@
 
 #include "prlog.h"
 #include "prinit.h"
 #include "prerror.h"
 
 #include "nsComponentManager.h"
 #include "nsCRTGlue.h"
 #include "nsModule.h"
-#include "nsThreadUtils.h"
 #include "nsTraceRefcntImpl.h"
 
 #include "nsILocalFile.h"
 #include "nsIModule.h"
-#include "nsIProxyObjectManager.h"
 
 #ifdef XP_WIN
 #include <windows.h>
 #endif
 
 #ifdef XP_MACOSX
 #include <signal.h>
 #endif
@@ -95,45 +93,26 @@ NS_IMPL_QUERY_INTERFACE1(nsNativeModuleL
 NS_IMPL_ADDREF_USING_AGGREGATOR(nsNativeModuleLoader,
                                 nsComponentManagerImpl::gComponentManager)
 NS_IMPL_RELEASE_USING_AGGREGATOR(nsNativeModuleLoader,
                                  nsComponentManagerImpl::gComponentManager)
 
 nsresult
 nsNativeModuleLoader::Init()
 {
-    NS_ASSERTION(NS_IsMainThread(), "Startup not on main thread?");
-
     LOG(PR_LOG_DEBUG, ("nsNativeModuleLoader::Init()"));
 
     return mLibraries.Init() ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
 }
 
 NS_IMETHODIMP
 nsNativeModuleLoader::LoadModule(nsILocalFile* aFile, nsIModule* *aResult)
 {
     nsresult rv;
 
-    if (!NS_IsMainThread()) {
-        // If this call is off the main thread, synchronously proxy it
-        // to the main thread.
-        
-        nsCOMPtr<nsIModuleLoader> proxythis;
-        rv = NS_GetProxyForObject(NS_PROXY_TO_MAIN_THREAD,
-                                  NS_GET_IID(nsIModuleLoader),
-                                  this, NS_PROXY_SYNC,
-                                  getter_AddRefs(proxythis));
-        if (NS_FAILED(rv))
-            return rv;
-
-        return proxythis->LoadModule(aFile, aResult);
-    }
-
-    NS_ASSERTION(NS_IsMainThread(), "LoadModule should always proxy to the main thread!");
-
     // Only load components that end in the proper dynamic library suffix
     nsCAutoString filePath;
     aFile->GetNativePath(filePath);
     if (!StringTail(filePath, sizeof(MOZ_DLL_SUFFIX) - 1).
         LowerCaseEqualsLiteral(MOZ_DLL_SUFFIX))
         return NS_ERROR_INVALID_ARG;
 
     nsCOMPtr<nsIHashable> hashedFile(do_QueryInterface(aFile));
@@ -271,13 +250,11 @@ nsNativeModuleLoader::UnloaderFunc(nsIHa
 #endif
 
     return PL_DHASH_REMOVE;
 }
 
 void
 nsNativeModuleLoader::UnloadLibraries()
 {
-    NS_ASSERTION(NS_IsMainThread(), "Shutdown not on main thread?");
-
     mLibraries.Enumerate(ReleaserFunc, nsnull);
     mLibraries.Enumerate(UnloaderFunc, nsnull);
 }