Trying to fix random orange, backing out
Bug 463289,
--- 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);
}