Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(16)

Unified Diff: content/browser/service_worker/service_worker_controllee_request_handler.cc

Issue 1280133002: Set skip_service_worker in ServiceWorkerControlleeRequestHandler only for subresource requests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698