From 768366d7b8080c556d31d0c84dc0903dff305dad Mon Sep 17 00:00:00 2001 From: Yaron Tausky Date: Tue, 15 Jun 2021 08:52:39 +0000 Subject: [PATCH] Bug 1496997 - Remove dom.serviceWorkers.parent_intercept pref r=asuth,dom-workers-and-storage-reviewers,perftest-reviewers,jgraham,sparky,webdriver-reviewers,whimboo Differential Revision: https://phabricator.services.mozilla.com/D101788 --- .../src/actions/debug-targets.js | 3 +-- docshell/base/nsAboutRedirector.cpp | 5 ++-- .../test/test_serviceworker_lifetime.html | 5 +--- dom/serviceworkers/ServiceWorkerManager.h | 3 +-- .../test/test_abrupt_completion.html | 5 +--- dom/serviceworkers/test/test_scopes.html | 24 +++++++------------ .../browser_privilegedmozilla_remoteworker.js | 1 - layout/tools/reftest/manifest.jsm | 2 +- modules/libpref/init/StaticPrefList.yaml | 7 ------ remote/mach_commands.py | 4 +--- taskcluster/taskgraph/transforms/tests.py | 2 -- testing/mochitest/mochitest_options.py | 1 - testing/mochitest/runtests.py | 4 +--- testing/raptor/raptor/raptor.py | 1 - .../content/SpecialPowersChild.jsm | 24 ------------------- testing/talos/talos/run_tests.py | 1 - testing/web-platform/fissionregressions.py | 3 --- .../inside-service-worker.https.html.ini | 7 ------ .../performance-timeline.https.html.ini | 3 +-- ...etes_in_disconnected_global.https.html.ini | 3 --- .../wptrunner/wptrunner/browsers/firefox.py | 11 +-------- testing/xpcshell/runxpcshelltests.py | 11 +-------- 22 files changed, 20 insertions(+), 110 deletions(-) delete mode 100644 testing/web-platform/meta/content-security-policy/securitypolicyviolation/inside-service-worker.https.html.ini delete mode 100644 testing/web-platform/mozilla/meta/service-workers/update_completes_in_disconnected_global.https.html.ini diff --git a/devtools/client/aboutdebugging/src/actions/debug-targets.js b/devtools/client/aboutdebugging/src/actions/debug-targets.js index 1d0fcb7da9c7..7566711a8844 100644 --- a/devtools/client/aboutdebugging/src/actions/debug-targets.js +++ b/devtools/client/aboutdebugging/src/actions/debug-targets.js @@ -123,8 +123,7 @@ function installTemporaryExtension() { function pushServiceWorker(id, registrationFront) { return async ({ dispatch, getState }) => { try { - // The push button is only available if canDebugServiceWorkers is true, - // which is only true if dom.serviceWorkers.parent_intercept is true. + // The push button is only available if canDebugServiceWorkers is true. // With this configuration, `push` should always be called on the // registration front, and not on the (service) WorkerTargetActor. await registrationFront.push(); diff --git a/docshell/base/nsAboutRedirector.cpp b/docshell/base/nsAboutRedirector.cpp index d8add0b6fb11..a320b4ebd431 100644 --- a/docshell/base/nsAboutRedirector.cpp +++ b/docshell/base/nsAboutRedirector.cpp @@ -114,9 +114,8 @@ static const RedirEntry kRedirMap[] = { {"processes", "chrome://global/content/aboutProcesses.html", nsIAboutModule::ALLOW_SCRIPT}, // about:serviceworkers always wants to load in the parent process because - // when dom.serviceWorkers.parent_intercept is set to true (the new default) - // then the only place nsIServiceWorkerManager has any data is in the - // parent process. + // the only place nsIServiceWorkerManager has any data is in the parent + // process. // // There is overlap without about:debugging, but about:debugging is not // available on mobile at this time, and it's useful to be able to know if diff --git a/dom/push/test/test_serviceworker_lifetime.html b/dom/push/test/test_serviceworker_lifetime.html index 6e837ad5d719..30f191a119a4 100644 --- a/dom/push/test/test_serviceworker_lifetime.html +++ b/dom/push/test/test_serviceworker_lifetime.html @@ -176,10 +176,7 @@ }; } - let shutdownTopic = - SpecialPowers.getBoolPref("dom.serviceWorkers.parent_intercept", false) ? - "specialpowers-service-worker-shutdown" : - "service-worker-shutdown"; + let shutdownTopic = "specialpowers-service-worker-shutdown"; SpecialPowers.registerObservers("service-worker-shutdown"); function setShutdownObserver(expectingEvent) { diff --git a/dom/serviceworkers/ServiceWorkerManager.h b/dom/serviceworkers/ServiceWorkerManager.h index f7f53f89b1df..300eed12ae18 100644 --- a/dom/serviceworkers/ServiceWorkerManager.h +++ b/dom/serviceworkers/ServiceWorkerManager.h @@ -76,8 +76,7 @@ class ServiceWorkerUpdateFinishCallback { * installation, querying and event dispatch of ServiceWorkers for all the * origins in the process. * - * NOTE: the following documentation is a WIP and only applies with - * dom.serviceWorkers.parent_intercept=true: + * NOTE: the following documentation is a WIP: * * The ServiceWorkerManager (SWM) is a main-thread, parent-process singleton * that encapsulates the browser-global state of service workers. This state diff --git a/dom/serviceworkers/test/test_abrupt_completion.html b/dom/serviceworkers/test/test_abrupt_completion.html index d0060e4330a8..bb019c8134ea 100644 --- a/dom/serviceworkers/test/test_abrupt_completion.html +++ b/dom/serviceworkers/test/test_abrupt_completion.html @@ -23,10 +23,7 @@ let registration = null; async function startAndStopServiceWorker() { SpecialPowers.registerObservers("service-worker-shutdown"); - const spTopic = - SpecialPowers.getBoolPref("dom.serviceWorkers.parent_intercept") ? - "specialpowers-service-worker-shutdown" : - "service-worker-shutdown"; + const spTopic = "specialpowers-service-worker-shutdown"; const origIdleTimeout = SpecialPowers.getIntPref("dom.serviceWorkers.idle_timeout"); diff --git a/dom/serviceworkers/test/test_scopes.html b/dom/serviceworkers/test/test_scopes.html index 795dfe1ac44b..b23eaaef4f92 100644 --- a/dom/serviceworkers/test/test_scopes.html +++ b/dom/serviceworkers/test/test_scopes.html @@ -80,23 +80,15 @@ }); } - let getScope; - let parent_intercept_enabled = - SpecialPowers.getBoolPref("dom.serviceWorkers.parent_intercept"); + let chromeScript = SpecialPowers.loadChromeScript(chromeScriptSource); + let docPrincipal = SpecialPowers.wrap(document).nodePrincipal.spec; - if (parent_intercept_enabled) { - let chromeScript = SpecialPowers.loadChromeScript(chromeScriptSource); - let docPrincipal = SpecialPowers.wrap(document).nodePrincipal.spec; - - getScope = async (path) => { - let rv = await chromeScript.sendQuery("getScope", { principal: docPrincipal, path }); - if (rv.exception) - throw rv.exception; - return rv.scope; - }; - } else { - getScope = navigator.serviceWorker.getScopeForUrl.bind(navigator.serviceWorker); - } + getScope = async (path) => { + let rv = await chromeScript.sendQuery("getScope", { principal: docPrincipal, path }); + if (rv.exception) + throw rv.exception; + return rv.scope; + }; var base = new URL(".", document.baseURI); diff --git a/dom/workers/test/browser_privilegedmozilla_remoteworker.js b/dom/workers/test/browser_privilegedmozilla_remoteworker.js index c13ccf7098e8..d5e7befcdab7 100644 --- a/dom/workers/test/browser_privilegedmozilla_remoteworker.js +++ b/dom/workers/test/browser_privilegedmozilla_remoteworker.js @@ -7,7 +7,6 @@ add_task(async function setup() { ["dom.ipc.processCount.privilegedmozilla", 1], ["dom.serviceWorkers.enabled", true], ["dom.serviceWorkers.testing.enabled", true], - ["dom.serviceworkers.parent_intercept", true], ], }); }); diff --git a/layout/tools/reftest/manifest.jsm b/layout/tools/reftest/manifest.jsm index 5e7b5847d315..589b7f9dff78 100644 --- a/layout/tools/reftest/manifest.jsm +++ b/layout/tools/reftest/manifest.jsm @@ -637,7 +637,7 @@ function BuildConditionSandbox(aURL) { // Running with a variant enabled? sandbox.fission = Services.appinfo.fissionAutostart; - sandbox.serviceWorkerE10s = prefs.getBoolPref("dom.serviceWorkers.parent_intercept", false); + sandbox.serviceWorkerE10s = true; if (!g.dumpedConditionSandbox) { g.logger.info("Dumping JSON representation of sandbox"); diff --git a/modules/libpref/init/StaticPrefList.yaml b/modules/libpref/init/StaticPrefList.yaml index 3528b6be72a7..53710ba6c83e 100644 --- a/modules/libpref/init/StaticPrefList.yaml +++ b/modules/libpref/init/StaticPrefList.yaml @@ -3087,13 +3087,6 @@ value: false mirror: always -# If true. then the service worker interception and the ServiceWorkerManager -# will live in the parent process. This only takes effect on browser start. -- name: dom.serviceWorkers.parent_intercept - type: bool - value: true - mirror: never - - name: dom.serviceWorkers.testing.enabled type: RelaxedAtomicBool value: false diff --git a/remote/mach_commands.py b/remote/mach_commands.py index 31fc14bc2584..f1f382274915 100644 --- a/remote/mach_commands.py +++ b/remote/mach_commands.py @@ -639,9 +639,7 @@ class PuppeteerTest(MachCommandBase): options[kv[0]] = kv[1].strip() if enable_fission: - prefs.update( - {"fission.autostart": True, "dom.serviceWorkers.parent_intercept": True} - ) + prefs.update({"fission.autostart": True}) if verbosity == 1: prefs["remote.log.level"] = "Debug" diff --git a/taskcluster/taskgraph/transforms/tests.py b/taskcluster/taskgraph/transforms/tests.py index f5be57a20978..3dd0e2339727 100644 --- a/taskcluster/taskgraph/transforms/tests.py +++ b/taskcluster/taskgraph/transforms/tests.py @@ -242,7 +242,6 @@ TEST_VARIANTS = { "mozharness": { "extra-options": [ "--setpref=fission.autostart=true", - "--setpref=dom.serviceWorkers.parent_intercept=true", ], }, }, @@ -258,7 +257,6 @@ TEST_VARIANTS = { "mozharness": { "extra-options": [ "--setpref=fission.autostart=true", - "--setpref=dom.serviceWorkers.parent_intercept=true", "--enable-xorigin-tests", ], }, diff --git a/testing/mochitest/mochitest_options.py b/testing/mochitest/mochitest_options.py index c9d293d91a7c..2b92dbf4bb8e 100644 --- a/testing/mochitest/mochitest_options.py +++ b/testing/mochitest/mochitest_options.py @@ -1166,7 +1166,6 @@ class MochitestArguments(ArgumentContainer): if options.enable_fission: options.extraPrefs.append("fission.autostart=true") - options.extraPrefs.append("dom.serviceWorkers.parent_intercept=true") options.leakThresholds = { "default": options.defaultLeakThreshold, diff --git a/testing/mochitest/runtests.py b/testing/mochitest/runtests.py index ac0c6f5c3797..2a8c909f036d 100644 --- a/testing/mochitest/runtests.py +++ b/testing/mochitest/runtests.py @@ -2868,9 +2868,7 @@ toolbar#nav-bar { # # Currently for automation, the pref defaults to true (but can be # overridden with --setpref). - "serviceworker_e10s": self.extraPrefs.get( - "dom.serviceWorkers.parent_intercept", True - ), + "serviceworker_e10s": True, "sessionHistoryInParent": self.extraPrefs.get( "fission.sessionHistoryInParent", False ) diff --git a/testing/raptor/raptor/raptor.py b/testing/raptor/raptor/raptor.py index e406f8106704..3edfd0ec5bed 100644 --- a/testing/raptor/raptor/raptor.py +++ b/testing/raptor/raptor/raptor.py @@ -51,7 +51,6 @@ def main(args=sys.argv[1:]): args.extra_prefs.update( { "fission.autostart": True, - "dom.serviceWorkers.parent_intercept": True, } ) diff --git a/testing/specialpowers/content/SpecialPowersChild.jsm b/testing/specialpowers/content/SpecialPowersChild.jsm index f0b4b9e67442..0706ecaa5154 100644 --- a/testing/specialpowers/content/SpecialPowersChild.jsm +++ b/testing/specialpowers/content/SpecialPowersChild.jsm @@ -519,30 +519,6 @@ class SpecialPowersChild extends JSWindowActorChild { } async registeredServiceWorkers() { - // For the time being, if parent_intercept is false, we can assume that - // ServiceWorkers registered by the current test are all known to the SWM in - // this process. - if ( - !Services.prefs.getBoolPref("dom.serviceWorkers.parent_intercept", false) - ) { - let swm = Cc["@mozilla.org/serviceworkers/manager;1"].getService( - Ci.nsIServiceWorkerManager - ); - let regs = swm.getAllRegistrations(); - - // XXX This is shared with SpecialPowersAPIParent.jsm - let workers = new Array(regs.length); - for (let i = 0; i < workers.length; ++i) { - let { scope, scriptSpec } = regs.queryElementAt( - i, - Ci.nsIServiceWorkerRegistrationInfo - ); - workers[i] = { scope, scriptSpec }; - } - - return workers; - } - // Please see the comment in SpecialPowersObserver.jsm above // this._serviceWorkerListener's assignment for what this returns. if (this._serviceWorkerRegistered) { diff --git a/testing/talos/talos/run_tests.py b/testing/talos/talos/run_tests.py index 9ed178849670..c7d61bfd5a99 100755 --- a/testing/talos/talos/run_tests.py +++ b/testing/talos/talos/run_tests.py @@ -165,7 +165,6 @@ def run_tests(config, browser_config): if browser_config.get("enable_fission", False): browser_config["preferences"]["fission.autostart"] = True - browser_config["preferences"]["dom.serviceWorkers.parent_intercept"] = True browser_config["preferences"]["network.proxy.type"] = 2 browser_config["preferences"]["network.proxy.autoconfig_url"] = ( diff --git a/testing/web-platform/fissionregressions.py b/testing/web-platform/fissionregressions.py index 560c22f28ad2..887103690a99 100644 --- a/testing/web-platform/fissionregressions.py +++ b/testing/web-platform/fissionregressions.py @@ -58,7 +58,6 @@ run_infos = { "wasm": True, "e10s": True, "headless": False, - "sw-e10s": True, "fission": True, "sessionHistoryInParent": True, "swgl": False, @@ -110,7 +109,6 @@ run_infos = { "wasm": True, "e10s": True, "headless": False, - "sw-e10s": True, "fission": False, "sessionHistoryInParent": False, "swgl": False, @@ -162,7 +160,6 @@ run_infos = { "wasm": True, "e10s": True, "headless": False, - "sw-e10s": True, "fission": False, "sessionHistoryInParent": False, "swgl": False, diff --git a/testing/web-platform/meta/content-security-policy/securitypolicyviolation/inside-service-worker.https.html.ini b/testing/web-platform/meta/content-security-policy/securitypolicyviolation/inside-service-worker.https.html.ini deleted file mode 100644 index bda6d779d27a..000000000000 --- a/testing/web-platform/meta/content-security-policy/securitypolicyviolation/inside-service-worker.https.html.ini +++ /dev/null @@ -1,7 +0,0 @@ -[inside-service-worker.https.html] - expected: - if (os == "android") and e10s and not sw-e10s: TIMEOUT - [SecurityPolicyViolation event fired on global with the correct blockedURI.] - expected: - if (os == "android") and e10s and not sw-e10s: TIMEOUT - diff --git a/testing/web-platform/meta/service-workers/service-worker/performance-timeline.https.html.ini b/testing/web-platform/meta/service-workers/service-worker/performance-timeline.https.html.ini index f492d8c2cec7..600d0f49fb9e 100644 --- a/testing/web-platform/meta/service-workers/service-worker/performance-timeline.https.html.ini +++ b/testing/web-platform/meta/service-workers/service-worker/performance-timeline.https.html.ini @@ -3,6 +3,5 @@ prefs: [privacy.reduceTimerPrecision:false] disabled: true [Resource Timing] bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1432758 - expected: - if sw-e10s: FAIL + expected: FAIL diff --git a/testing/web-platform/mozilla/meta/service-workers/update_completes_in_disconnected_global.https.html.ini b/testing/web-platform/mozilla/meta/service-workers/update_completes_in_disconnected_global.https.html.ini deleted file mode 100644 index 119b3115398e..000000000000 --- a/testing/web-platform/mozilla/meta/service-workers/update_completes_in_disconnected_global.https.html.ini +++ /dev/null @@ -1,3 +0,0 @@ -[update_completes_in_disconnected_global.https.html] - disabled: - if not sw-e10s: https://bugzilla.mozilla.org/show_bug.cgi?id=1589699 diff --git a/testing/web-platform/tests/tools/wptrunner/wptrunner/browsers/firefox.py b/testing/web-platform/tests/tools/wptrunner/wptrunner/browsers/firefox.py index 40810c802c3b..ac27453127ab 100644 --- a/testing/web-platform/tests/tools/wptrunner/wptrunner/browsers/firefox.py +++ b/testing/web-platform/tests/tools/wptrunner/wptrunner/browsers/firefox.py @@ -237,21 +237,12 @@ def run_info_extras(**kwargs): "wasm": kwargs.get("wasm", True), "verify": kwargs["verify"], "headless": kwargs.get("headless", False) or "MOZ_HEADLESS" in os.environ, - "sw-e10s": True, "fission": kwargs.get("enable_fission") or get_bool_pref("fission.autostart"), "sessionHistoryInParent": (kwargs.get("enable_fission") or get_bool_pref("fission.autostart") or get_bool_pref("fission.sessionHistoryInParent")), "swgl": get_bool_pref("gfx.webrender.software")} - # The value of `sw-e10s` defaults to whether the "parent_intercept" - # implementation is enabled for the current build. This value, however, - # can be overridden by explicitly setting the pref with the `--setpref` CLI - # flag, which is checked here. - sw_e10s_override = get_bool_pref_if_exists("dom.serviceWorkers.parent_intercept") - if sw_e10s_override is not None: - rv["sw-e10s"] = sw_e10s_override - rv.update(run_info_browser_version(**kwargs)) return rv @@ -272,7 +263,7 @@ def run_info_browser_version(**kwargs): def update_properties(): - return (["os", "debug", "webrender", "fission", "e10s", "sw-e10s", "processor", "swgl"], + return (["os", "debug", "webrender", "fission", "e10s", "processor", "swgl"], {"os": ["version"], "processor": ["bits"]}) diff --git a/testing/xpcshell/runxpcshelltests.py b/testing/xpcshell/runxpcshelltests.py index c690743ac3cb..4267bcec2ceb 100755 --- a/testing/xpcshell/runxpcshelltests.py +++ b/testing/xpcshell/runxpcshelltests.py @@ -1536,16 +1536,7 @@ class XPCShellTests(object): self.mozInfo["fission"] = prefs.get("fission.autostart", False) - # Until the test harness can understand default pref values, - # (https://bugzilla.mozilla.org/show_bug.cgi?id=1577912) this value - # should by synchronized with the default pref value indicated in - # StaticPrefList.yaml. - # - # Currently for automation, the pref defaults to true (but can be - # overridden with --setpref). - self.mozInfo["serviceworker_e10s"] = prefs.get( - "dom.serviceWorkers.parent_intercept", True - ) + self.mozInfo["serviceworker_e10s"] = True self.mozInfo["verify"] = options.get("verify", False) self.mozInfo["webrender"] = self.enable_webrender