Bug 1320343 - Avoid to set Preference in the GPU process; r=kip
authorDaosheng Mu <daoshengmu@gmail.com>
Sat, 26 Nov 2016 23:06:34 +0800
changeset 324578 0f7296d6e742645e856c00c94034fb3df59a9c3c
parent 324577 a662d5cccbe5e80d31a3538b71a5953999dcad50
child 324579 48164669baec8e7bfe78bff9a44731f383d35bd2
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +0000
reviewerskip
bugs1320343
milestone53.0a1
Bug 1320343 - Avoid to set Preference in the GPU process; r=kip MozReview-Commit-ID: I73foOQh7L0
gfx/vr/VRManager.cpp
--- a/gfx/vr/VRManager.cpp
+++ b/gfx/vr/VRManager.cpp
@@ -90,17 +90,18 @@ VRManager::VRManager()
 
   // OSVR is cross platform compatible
   mgr = VRDisplayManagerOSVR::Create();
   if (mgr) {
       mManagers.AppendElement(mgr);
   }
 #endif
   // Enable gamepad extensions while VR is enabled.
-  if (gfxPrefs::VREnabled()) {
+  // Preference only can be set at the Parent process.
+  if (XRE_IsParentProcess() && gfxPrefs::VREnabled()) {
     Preferences::SetBool("dom.gamepad.extensions.enabled", true);
   }
 }
 
 VRManager::~VRManager()
 {
   MOZ_ASSERT(NS_IsMainThread());
   MOZ_ASSERT(!mInitialized);