Bug 1288618 - Part 7: Initialize AbstractThread in the GPU process. r?dvander draft
authorMatt Woodrow <mwoodrow@mozilla.com>
Thu, 15 Sep 2016 14:24:16 +1200
changeset 413860 3b5ecfc317e8af0b5a4061191dfcb867afb351e1
parent 413859 520252be8bf2a938885969965869e5353c984897
child 413861 d29c09fa35b5a76e335ceec167a8106f289cbe02
push id29543
push usermwoodrow@mozilla.com
push dateThu, 15 Sep 2016 02:36:28 +0000
reviewersdvander
bugs1288618
milestone51.0a1
Bug 1288618 - Part 7: Initialize AbstractThread in the GPU process. r?dvander MozReview-Commit-ID: 2ehntc2fDgO
xpcom/build/XPCOMInit.cpp
--- 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
 //