bug 820716 - Call OOPInit during startup. r=khuey
☠☠ backed out by 9312a2e6a0fd ☠ ☠
authorTed Mielczarek <ted@mielczarek.org>
Fri, 25 Jul 2014 07:29:39 -0400
changeset 217855 8613370d058a04d07d44460bbe74686cac152f04
parent 217854 a660ebbe6ff97b428c78f5f4e5921b094e57afb1
child 217856 0a54807683f28f2a5247084c44d0aa98500829b1
push id3979
push userraliiev@mozilla.com
push dateMon, 13 Oct 2014 16:35:44 +0000
treeherdermozilla-beta@30f2cc610691 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskhuey
bugs820716
milestone34.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
bug 820716 - Call OOPInit during startup. r=khuey
toolkit/crashreporter/nsExceptionHandler.cpp
toolkit/xre/nsAppRunner.cpp
--- a/toolkit/crashreporter/nsExceptionHandler.cpp
+++ b/toolkit/crashreporter/nsExceptionHandler.cpp
@@ -2542,31 +2542,16 @@ static bool ChildFilter(void *context) {
   mozilla::IOInterposer::Disable();
   return true;
 }
 #endif
 
 void
 OOPInit()
 {
-  class ProxyToMainThread : public nsRunnable
-  {
-  public:
-    NS_IMETHOD Run() {
-      OOPInit();
-      return NS_OK;
-    }
-  };
-  if (!NS_IsMainThread()) {
-    // This logic needs to run on the main thread
-    nsCOMPtr<nsIThread> mainThread = do_GetMainThread();
-    mozilla::SyncRunnable::DispatchToThread(mainThread, new ProxyToMainThread());
-    return;
-  }
-
   if (OOPInitialized())
     return;
 
   MOZ_ASSERT(NS_IsMainThread());
 
   NS_ABORT_IF_FALSE(gExceptionHandler != nullptr,
                     "attempt to initialize OOP crash reporter before in-process crashreporter!");
 
--- a/toolkit/xre/nsAppRunner.cpp
+++ b/toolkit/xre/nsAppRunner.cpp
@@ -4075,16 +4075,22 @@ XREMain::XRE_main(int argc, char* argv[]
   // Start the real application
   mScopedXPCom = new ScopedXPCOMStartup();
   if (!mScopedXPCom)
     return 1;
 
   rv = mScopedXPCom->Initialize();
   NS_ENSURE_SUCCESS(rv, 1);
 
+#ifdef MOZ_CRASHREPORTER
+  if (CrashReporter::GetEnabled()) {
+    CrashReporter::OOPInit();
+  }
+#endif
+
   // run!
   rv = XRE_mainRun();
 
 #ifdef MOZ_INSTRUMENT_EVENT_LOOP
   mozilla::ShutdownEventTracing();
 #endif
 
   // Check for an application initiated restart.  This is one that