Bug 1210941 P7 Use LOAD_BYPASS_SERVICE_WORKER in ServiceWorkerScriptCache. r=ehsan
authorBen Kelly <ben@wanderview.com>
Tue, 06 Oct 2015 06:37:07 -0700
changeset 266269 6532d08e71c6ccece3a1f84aefab26d8c5c014b0
parent 266268 6d4f02b052139103d7dcd7f687a22efb0579ab47
child 266270 9184e91f177d5ff6937b5ed712e62af80270bd81
push id66154
push userbkelly@mozilla.com
push dateTue, 06 Oct 2015 13:37:16 +0000
treeherdermozilla-inbound@89416f2918ed [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan
bugs1210941
milestone44.0a1
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
Bug 1210941 P7 Use LOAD_BYPASS_SERVICE_WORKER in ServiceWorkerScriptCache. r=ehsan
dom/workers/ServiceWorkerScriptCache.cpp
--- a/dom/workers/ServiceWorkerScriptCache.cpp
+++ b/dom/workers/ServiceWorkerScriptCache.cpp
@@ -112,17 +112,19 @@ public:
 
     // Note that because there is no "serviceworker" RequestContext type, we can
     // use the TYPE_INTERNAL_SCRIPT content policy types when loading a service
     // worker.
     rv = NS_NewChannel(getter_AddRefs(mChannel),
                        uri, aPrincipal,
                        nsILoadInfo::SEC_NORMAL,
                        nsIContentPolicy::TYPE_INTERNAL_SCRIPT,
-                       loadGroup);
+                       loadGroup,
+                       nullptr, // aCallbacks
+                       nsIChannel::LOAD_BYPASS_SERVICE_WORKER);
     if (NS_WARN_IF(NS_FAILED(rv))) {
       return rv;
     }
 
     nsLoadFlags flags;
     rv = mChannel->GetLoadFlags(&flags);
     if (NS_WARN_IF(NS_FAILED(rv))) {
       return rv;
@@ -135,22 +137,16 @@ public:
     }
 
     nsCOMPtr<nsIHttpChannel> httpChannel = do_QueryInterface(mChannel);
     if (httpChannel) {
       // Spec says no redirects allowed for SW scripts.
       httpChannel->SetRedirectionLimit(0);
     }
 
-    // Don't let serviceworker intercept.
-    nsCOMPtr<nsIHttpChannelInternal> internalChannel = do_QueryInterface(mChannel);
-    if (internalChannel) {
-      internalChannel->ForceNoIntercept();
-    }
-
     nsCOMPtr<nsIStreamLoader> loader;
     rv = NS_NewStreamLoader(getter_AddRefs(loader), this, this);
     if (NS_WARN_IF(NS_FAILED(rv))) {
       return rv;
     }
 
     rv = mChannel->AsyncOpen(loader, nullptr);
     if (NS_WARN_IF(NS_FAILED(rv))) {