Bug 1384459 - Disable WebVR by default for 32-bit builds draft
authorKearwood "Kip" Gilbert <kgilbert@mozilla.com>
Wed, 26 Jul 2017 01:01:41 -0700
changeset 615732 c8e5c477483504d26a834fbd2aa29b8103ea09bc
parent 615176 32d9d1e81cc607320a36391845917f645f7a7f72
child 639255 91da9e5ea7d29546852b2d917a60135644b5ee99
push id70447
push userkgilbert@mozilla.com
push dateWed, 26 Jul 2017 08:52:17 +0000
bugs1384459
milestone56.0a1
Bug 1384459 - Disable WebVR by default for 32-bit builds We wish to enable WebVR only for 64-bit builds before it rides the trains with 55 in release. This will serve a few purposes: - Reduction of test requirements by reduction of configuration matrices. - Ensuring that the optimal 64-bit builds are used for WebVR sites, which are often likely to hit 32-bit address space fragmentation limitations resulting in OOMs. - Act as a rudimentary soft-launch in 55. 56 is expected to bring a larger set of users to 64-bit builds. MozReview-Commit-ID: ADVcBKvS0mP
dom/vr/test/mochitest/runVRTest.js
dom/vr/test/reftest/reftest.list
gfx/thebes/gfxPrefs.h
modules/libpref/init/all.js
--- a/dom/vr/test/mochitest/runVRTest.js
+++ b/dom/vr/test/mochitest/runVRTest.js
@@ -1,9 +1,10 @@
 function runVRTest(callback) {
   SpecialPowers.pushPrefEnv({"set" : [["dom.vr.puppet.enabled", true],
                                       ["dom.vr.require-gesture", false],
+                                      ["dom.vr.enabled", true],
                                       ["dom.vr.test.enabled", true]]},
   () => {
     VRServiceTest = navigator.requestVRServiceTest();
     callback();
   });
 }
\ No newline at end of file
--- a/dom/vr/test/reftest/reftest.list
+++ b/dom/vr/test/reftest/reftest.list
@@ -1,8 +1,8 @@
 # WebVR Reftests
-default-preferences pref(dom.vr.puppet.enabled,true) pref(dom.vr.test.enabled,true) pref(dom.vr.require-gesture,false) pref(dom.vr.puppet.submitframe,1)
+default-preferences pref(dom.vr.puppet.enabled,true) pref(dom.vr.test.enabled,true) pref(dom.vr.require-gesture,false) pref(dom.vr.puppet.submitframe,1) pref(dom.vr.enabled,true)
 
 # VR SubmitFrame is only implemented for D3D11 now.
 # We need to continue to investigate why these reftests can be run well in local,
 # but will be suspended until terminating on reftest debug build.
 skip-if(!winWidget||!layersGPUAccelerated||isDebugBuild) == draw_rect.html wrapper.html?draw_rect.png
 skip-if(!winWidget||!layersGPUAccelerated||isDebugBuild) == change_size.html wrapper.html?change_size.png
--- a/gfx/thebes/gfxPrefs.h
+++ b/gfx/thebes/gfxPrefs.h
@@ -348,17 +348,21 @@ private:
   DECL_GFX_PREF(Live, "apz.scale_repaint_delay_ms",            APZScaleRepaintDelay, int32_t, 500);
 
   DECL_GFX_PREF(Live, "browser.ui.scroll-toolbar-threshold",   ToolbarScrollThreshold, int32_t, 10);
   DECL_GFX_PREF(Live, "browser.ui.zoom.force-user-scalable",   ForceUserScalable, bool, false);
   DECL_GFX_PREF(Live, "browser.viewport.desktopWidth",         DesktopViewportWidth, int32_t, 980);
 
   DECL_GFX_PREF(Live, "dom.ipc.plugins.asyncdrawing.enabled",  PluginAsyncDrawingEnabled, bool, false);
   DECL_GFX_PREF(Live, "dom.meta-viewport.enabled",             MetaViewportEnabled, bool, false);
+#if defined(HAVE_64BIT_BUILD)
+  DECL_GFX_PREF(Once, "dom.vr.enabled",                        VREnabled, bool, true);
+#else
   DECL_GFX_PREF(Once, "dom.vr.enabled",                        VREnabled, bool, false);
+#endif
   DECL_GFX_PREF(Live, "dom.vr.autoactivate.enabled",           VRAutoActivateEnabled, bool, false);
   DECL_GFX_PREF(Live, "dom.vr.controller_trigger_threshold",   VRControllerTriggerThreshold, float, 0.1f);
   DECL_GFX_PREF(Live, "dom.vr.navigation.timeout",             VRNavigationTimeout, int32_t, 1000);
   DECL_GFX_PREF(Once, "dom.vr.oculus.enabled",                 VROculusEnabled, bool, true);
   DECL_GFX_PREF(Live, "dom.vr.oculus.present.timeout",         VROculusPresentTimeout, int32_t, 10000);
   DECL_GFX_PREF(Live, "dom.vr.oculus.quit.timeout",            VROculusQuitTimeout, int32_t, 30000);
   DECL_GFX_PREF(Once, "dom.vr.openvr.enabled",                 VROpenVREnabled, bool, false);
   DECL_GFX_PREF(Once, "dom.vr.osvr.enabled",                   VROSVREnabled, bool, false);
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -5207,23 +5207,29 @@ pref("network.activity.blipIntervalMilli
 
 // When we're asked to take a screenshot, don't wait more than 2000ms for the
 // event loop to become idle before actually taking the screenshot.
 pref("dom.browserElement.maxScreenshotDelayMS", 2000);
 
 // Whether we should show the placeholder when the element is focused but empty.
 pref("dom.placeholder.show_on_focus", true);
 
-// WebVR is enabled by default in beta and release for Windows and for all
-// platforms in nightly and aurora.
-#if defined(XP_WIN) || !defined(RELEASE_OR_BETA)
+#if !defined(HAVE_64BIT_BUILD)
+// WebVR is not enabled for 32-bit builds.  (See Bug 1384459)
+pref("dom.vr.enabled", false);
+#elif defined(XP_WIN)
+// WebVR is enabled by default for Windows in beta and release
+pref("dom.vr.enabled", true);
+#elif !defined(RELEASE_OR_BETA)
+// WebVR is enabled for all platforms in nightly.
 pref("dom.vr.enabled", true);
 #else
 pref("dom.vr.enabled", false);
 #endif
+
 // It is often desirable to automatically start vr presentation when
 // a user puts on the VR headset.  This is done by emitting the
 // Window.vrdisplayactivate event when the headset's sensors detect it
 // being worn.  This can result in WebVR content taking over the headset
 // when the user is using it outside the browser or inadvertent start of
 // presentation due to the high sensitivity of the proximity sensor in some
 // headsets, so it is off by default.
 pref("dom.vr.autoactivate.enabled", false);