From f43590de332583e74bfc37bfd32fe9a72e9e8dff Mon Sep 17 00:00:00 2001 From: Ben Kelly Date: Wed, 13 Sep 2017 05:53:54 -0700 Subject: [PATCH] Bug 1398484 Only assert that the channel does not change for top level service worker scripts. r=baku --- dom/workers/ScriptLoader.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dom/workers/ScriptLoader.cpp b/dom/workers/ScriptLoader.cpp index 141101d4d781..e8fd8f040533 100644 --- a/dom/workers/ScriptLoader.cpp +++ b/dom/workers/ScriptLoader.cpp @@ -680,7 +680,12 @@ private: ScriptLoadInfo& loadInfo = mLoadInfos[aIndex]; nsCOMPtr channel = do_QueryInterface(aRequest); - MOZ_ASSERT(channel == loadInfo.mChannel); + + // Note that importScripts() can redirect. In theory the main + // script could also encounter an internal redirect, but currently + // the assert does not allow that. + MOZ_ASSERT_IF(mIsMainScript, channel == loadInfo.mChannel); + loadInfo.mChannel = channel; // We synthesize the result code, but its never exposed to content. RefPtr ir =