Backed out changeset 92d629854868 (bug 1603484) for wpt failures on service-worker/import-scripts-updated-flag.https.html.
authorCosmin Sabou <csabou@mozilla.com>
Thu, 30 Jan 2020 15:02:06 +0200
changeset 512125 36440af6bb5a480223db693863b49dc1a6f3fdb7
parent 512124 4ba3576a07615d1dadedf55d3cbdb9bee0df8a33
child 512126 f97c48da9ceeb30bd0c974a72fcc7db11e5cb8db
push id37072
push usercsabou@mozilla.com
push dateThu, 30 Jan 2020 15:44:43 +0000
treeherdermozilla-central@f97c48da9cee [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1603484
milestone74.0a1
backs out92d62985486856c0fb0b5a7b940816e19b1faf64
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset 92d629854868 (bug 1603484) for wpt failures on service-worker/import-scripts-updated-flag.https.html. CLOSED TREE
dom/workers/ScriptLoader.cpp
--- a/dom/workers/ScriptLoader.cpp
+++ b/dom/workers/ScriptLoader.cpp
@@ -1706,21 +1706,20 @@ void CacheScriptLoader::ResolvedCallback
   // Depending on if a previous version of the service worker has
   // been installed or not it may also know about importScripts().  We
   // must handle loading and offlining new importScripts() here, however.
   if (aValue.isUndefined()) {
     // If this is the main script or we're not loading a new service worker
     // then this is an error.  This can happen for internal reasons, like
     // storage was probably wiped without removing the service worker
     // registration.  It can also happen for exposed reasons like the
-    // service worker script calling importScripts() after install. Right now
-    // we don't enforce the restriction on imported scripts due to breakage on
-    // on a certain website (see bug 1603484), but once the website is fixed we
-    // should start enforcing it again.
-    if (NS_WARN_IF(mIsWorkerScript)) {
+    // service worker script calling importScripts() after install.
+    if (NS_WARN_IF(mIsWorkerScript ||
+                   (mState != ServiceWorkerState::Parsed &&
+                    mState != ServiceWorkerState::Installing))) {
       Fail(NS_ERROR_DOM_INVALID_STATE_ERR);
       return;
     }
 
     mLoadInfo.mCacheStatus = ScriptLoadInfo::ToBeCached;
     rv = mRunnable->LoadScript(mIndex);
     if (NS_WARN_IF(NS_FAILED(rv))) {
       Fail(rv);