Bug 1204405: Don't access prefs off main thread in testing ProcessLink::Open(). r=khuey

This commit is contained in:
Cervantes Yu 2015-09-17 14:40:23 +08:00
parent d27129032a
commit f47edecb4b

View File

@ -13,7 +13,7 @@
#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)
@ -144,7 +144,7 @@ ProcessLink::Open(mozilla::ipc::Transport* aTransport, MessageLoop *aIOLoop, Sid
}
#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