Bug 1357486: Enable OOP extensions by default on Windows. r=aswan draft
authorKris Maglione <maglione.k@gmail.com>
Thu, 06 Jul 2017 21:13:40 -0700
changeset 605455 5589394a4f7e738374b59e468ca58714d9ba3ab2
parent 605454 09fc568235dd6dcf66bdf07d62b37aa7b1bc5336
child 605456 30a534be12015c49ccb7dd13dad41f498f230ba2
push id67414
push usermaglione.k@gmail.com
push dateFri, 07 Jul 2017 19:19:40 +0000
reviewersaswan
bugs1357486
milestone56.0a1
Bug 1357486: Enable OOP extensions by default on Windows. r=aswan MozReview-Commit-ID: 3Tet7tNtmGx
browser/app/profile/firefox.js
browser/components/extensions/test/browser/head.js
toolkit/components/extensions/Extension.jsm
toolkit/components/extensions/test/mochitest/head.js
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -79,16 +79,20 @@ pref("extensions.geckoProfiler.getSymbol
 pref("extensions.geckoProfiler.getSymbolRules", "localBreakpad,remoteBreakpad");
 #endif
 
 
 // Add-on content security policies.
 pref("extensions.webextensions.base-content-security-policy", "script-src 'self' https://* moz-extension: blob: filesystem: 'unsafe-eval' 'unsafe-inline'; object-src 'self' https://* moz-extension: blob: filesystem:;");
 pref("extensions.webextensions.default-content-security-policy", "script-src 'self'; object-src 'self';");
 
+#ifdef XP_WIN
+pref("extensions.webextensions.remote", true);
+#endif
+
 // Extensions that should not be flagged as legacy in about:addons
 pref("extensions.legacy.exceptions", "{972ce4c6-7e08-4474-a285-3208198ce6fd},testpilot@cliqz.com,@testpilot-containers,jid1-NeEaf3sAHdKHPA@jetpack,@activity-streams,pulse@mozilla.com,@testpilot-addon,@min-vid,tabcentertest1@mozilla.com,snoozetabs@mozilla.com,speaktome@mozilla.com,hoverpad@mozilla.com");
 
 // Require signed add-ons by default
 pref("xpinstall.signatures.required", true);
 pref("xpinstall.signatures.devInfoURL", "https://wiki.mozilla.org/Addons/Extension_Signing");
 
 // Dictionary download preference
--- a/browser/components/extensions/test/browser/head.js
+++ b/browser/components/extensions/test/browser/head.js
@@ -33,21 +33,21 @@ PromiseTestUtils.whitelistRejectionsGlob
 
 const {AppConstants} = Cu.import("resource://gre/modules/AppConstants.jsm", {});
 const {CustomizableUI} = Cu.import("resource:///modules/CustomizableUI.jsm", {});
 
 // We run tests under two different configurations, from browser.ini and
 // browser-remote.ini. When running from browser-remote.ini, the tests are
 // copied to the sub-directory "test-oop-extensions", which we detect here, and
 // use to select our configuration.
-if (gTestPath.includes("test-oop-extensions")) {
-  SpecialPowers.pushPrefEnv({set: [
-    ["extensions.webextensions.remote", true],
-    ["layers.popups.compositing.enabled", true],
-  ]});
+let remote = gTestPath.includes("test-oop-extensions");
+SpecialPowers.pushPrefEnv({set: [
+  ["extensions.webextensions.remote", remote],
+]});
+if (remote) {
   // We don't want to reset this at the end of the test, so that we don't have
   // to spawn a new extension child process for each test unit.
   SpecialPowers.setIntPref("dom.ipc.keepProcessesAlive.extension", 1);
 }
 
 // Bug 1239884: Our tests occasionally hit a long GC pause at unpredictable
 // times in debug builds, which results in intermittent timeouts. Until we have
 // a better solution, we force a GC after certain strategic tests, which tend to
--- a/toolkit/components/extensions/Extension.jsm
+++ b/toolkit/components/extensions/Extension.jsm
@@ -740,20 +740,16 @@ this.Extension = class extends Extension
       StartupCache.clearAddonData(addonData.id);
     }
 
     this.remote = useRemoteWebExtensions;
 
     if (this.remote && processCount !== 1) {
       throw new Error("Out-of-process WebExtensions are not supported with multiple child processes");
     }
-    if (this.remote && !Services.prefs.getBoolPref("layers.popups.compositing.enabled", false)) {
-      Cu.reportError(new Error("Remote extensions should not be enabled without also setting " +
-                               "the layers.popups.compositing.enabled preference to true"));
-    }
 
     // This is filled in the first time an extension child is created.
     this.parentMessageManager = null;
 
     this.id = addonData.id;
     this.version = addonData.version;
     this.baseURI = NetUtil.newURI(this.getURL("")).QueryInterface(Ci.nsIURL);
     this.principal = this.createPrincipal();
--- a/toolkit/components/extensions/test/mochitest/head.js
+++ b/toolkit/components/extensions/test/mochitest/head.js
@@ -3,21 +3,21 @@
 /* exported AppConstants, Assert */
 
 var {AppConstants} = SpecialPowers.Cu.import("resource://gre/modules/AppConstants.jsm", {});
 
 // We run tests under two different configurations, from mochitest.ini and
 // mochitest-remote.ini. When running from mochitest-remote.ini, the tests are
 // copied to the sub-directory "test-oop-extensions", which we detect here, and
 // use to select our configuration.
-if (location.pathname.includes("test-oop-extensions")) {
-  SpecialPowers.pushPrefEnv({set: [
-    ["extensions.webextensions.remote", true],
-    ["layers.popups.compositing.enabled", true],
-  ]});
+let remote = location.pathname.includes("test-oop-extensions");
+SpecialPowers.pushPrefEnv({set: [
+  ["extensions.webextensions.remote", remote],
+]});
+if (remote) {
   // We don't want to reset this at the end of the test, so that we don't have
   // to spawn a new extension child process for each test unit.
   SpecialPowers.setIntPref("dom.ipc.keepProcessesAlive.extension", 1);
 }
 
 {
   let chromeScript = SpecialPowers.loadChromeScript(
     SimpleTest.getTestFileURL("chrome_cleanup_script.js"));