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 297400 15cc3c9efd9d0d615edbd2da1b88e8b6f1fa4463
parent 297399 99c11d836978425de6256aa5baf355843f39f400
child 297401 691a54f38d8416af86177910ad1cf44381390fe1
push id962
push userjlund@mozilla.com
push dateFri, 04 Dec 2015 23:28:54 +0000
treeherdermozilla-release@23a2d286e80f [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