Index: content/browser/service_worker/service_worker_controllee_request_handler.cc |
diff --git a/content/browser/service_worker/service_worker_controllee_request_handler.cc b/content/browser/service_worker/service_worker_controllee_request_handler.cc |
index a8af415c1c55e750fffe72b5243be9f3263d34f5..ff6087c1cc6cdcfb39aeee5e517c07b9e98be710 100644 |
--- a/content/browser/service_worker/service_worker_controllee_request_handler.cc |
+++ b/content/browser/service_worker/service_worker_controllee_request_handler.cc |
@@ -86,10 +86,12 @@ net::URLRequestJob* ServiceWorkerControlleeRequestHandler::MaybeCreateJob( |
// We've come here by restart, we already have original request and it |
// tells we should fallback to network. (Case B-c) |
- // Once the request was fallbacked to the network, skip-service-worker flag |
- // must be set and the request shoud not go to the service worker. |
if ((job_.get() && job_->ShouldFallbackToNetwork()) || skip_service_worker_) { |
- skip_service_worker_ = true; |
+ // Once a subresource request was fallbacked to the network, we set |
+ // |skip_service_worker_| and the request shoud not go to the service |
+ // worker. |
+ if (!is_main_resource_load_) |
+ skip_service_worker_ = true; |
job_ = NULL; |
return NULL; |
} |
@@ -113,6 +115,11 @@ net::URLRequestJob* ServiceWorkerControlleeRequestHandler::MaybeCreateJob( |
// the storage lookup returned immediately), just return NULL here to |
// fallback to network. |
job_ = NULL; |
+ // Once a subresource request was fallbacked to the network, we set |
+ // |skip_service_worker_| and the request shoud not go to the service |
+ // worker. |
+ if (!is_main_resource_load_) |
+ skip_service_worker_ = true; |
falken
2015/08/10 04:56:15
Can you factor these out to a helper function so w
horo
2015/08/10 05:43:41
Done.
|
return NULL; |
} |