Bug 1204405: Don't access prefs off main thread in testing ProcessLink::Open(). r=khuey
authorCervantes Yu <cyu@mozilla.com>
Thu, 17 Sep 2015 14:40:23 +0800
changeset 295695 15cc3c9efd9d
parent 295694 99c11d836978
child 295696 691a54f38d84
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskhuey
bugs1204405
milestone43.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 1204405: Don't access prefs off main thread in testing ProcessLink::Open(). r=khuey
ipc/glue/MessageLink.cpp
--- a/ipc/glue/MessageLink.cpp
+++ b/ipc/glue/MessageLink.cpp
@@ -8,17 +8,17 @@
 #include "mozilla/ipc/MessageLink.h"
 #include "mozilla/ipc/MessageChannel.h"
 #include "mozilla/ipc/BrowserProcessSubThread.h"
 #include "mozilla/ipc/ProtocolUtils.h"
 
 #ifdef MOZ_NUWA_PROCESS
 #include "ipc/Nuwa.h"
 #include "mozilla/Preferences.h"
-#include "mozilla/dom/PContent.h"
+#include "mozilla/dom/ContentParent.h"
 #include "mozilla/dom/PNuwa.h"
 #include "mozilla/hal_sandbox/PHal.h"
 #if defined(DEBUG) || defined(ENABLE_TESTS)
 #include "jsprf.h"
 extern "C" char* PrintJSStack();
 #endif
 #endif
 
@@ -139,17 +139,17 @@ ProcessLink::Open(mozilla::ipc::Transpor
             // over the channel from the previous listener and process
             // any queued messages.
             mIOLoop->PostTask(
                 FROM_HERE,
                 NewRunnableMethod(this, &ProcessLink::OnTakeConnectedChannel));
         }
 
 #ifdef MOZ_NUWA_PROCESS
-        if (IsNuwaProcess() &&
+        if (IsNuwaProcess() && NS_IsMainThread() &&
             Preferences::GetBool("dom.ipc.processPrelaunch.testMode")) {
             // The pref value is turned on in a deadlock test against the Nuwa
             // process. The sleep here makes it easy to trigger the deadlock
             // that an IPC channel is still opening but the worker loop is
             // already frozen.
             sleep(5);
         }
 #endif