Bug 1288618 - Part 7: Initialize AbstractThread in the GPU process. r?dvander
MozReview-Commit-ID: 2ehntc2fDgO
--- a/xpcom/build/XPCOMInit.cpp
+++ b/xpcom/build/XPCOMInit.cpp
@@ -687,16 +687,19 @@ NS_InitXPCOM2(nsIServiceManager** aResul
#endif
// Initialize the JS engine.
const char* jsInitFailureReason = JS_InitWithFailureDiagnostic();
if (jsInitFailureReason) {
NS_RUNTIMEABORT(jsInitFailureReason);
}
sInitializedJS = true;
+
+ // Init AbstractThread.
+ AbstractThread::InitStatics();
rv = nsComponentManagerImpl::gComponentManager->Init();
if (NS_FAILED(rv)) {
NS_RELEASE(nsComponentManagerImpl::gComponentManager);
return rv;
}
if (aResult) {
@@ -710,19 +713,16 @@ NS_InitXPCOM2(nsIServiceManager** aResul
// After autoreg, but before we actually instantiate any components,
// add any services listed in the "xpcom-directory-providers" category
// to the directory service.
nsDirectoryService::gService->RegisterCategoryProviders();
// Init SharedThreadPool (which needs the service manager).
SharedThreadPool::InitStatics();
- // Init AbstractThread.
- AbstractThread::InitStatics();
-
// Force layout to spin up so that nsContentUtils is available for cx stack
// munging.
nsCOMPtr<nsISupports> componentLoader =
do_GetService("@mozilla.org/moz/jsloader;1");
mozilla::scache::StartupCache::GetSingleton();
mozilla::AvailableMemoryTracker::Activate();
@@ -796,16 +796,18 @@ NS_InitMinimalXPCOM()
return rv;
}
// Global cycle collector initialization.
if (!nsCycleCollector_init()) {
return NS_ERROR_UNEXPECTED;
}
+ AbstractThread::InitStatics();
+
return NS_OK;
}
//
// NS_ShutdownXPCOM()
//
// The shutdown sequence for xpcom would be
//