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

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

Issue 1274973002: Don't send the redirected request once the request was fallbacked to the network. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: place parentheses around the '&&' expression 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
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 1f383d73ee5a8b89ffef2d00cfc045b34ea29e4c..e90d43dc2142f8c12d66d9f729fb2757cb78ae4b 100644
--- a/content/browser/service_worker/service_worker_controllee_request_handler.cc
+++ b/content/browser/service_worker/service_worker_controllee_request_handler.cc
@@ -43,8 +43,8 @@ ServiceWorkerControlleeRequestHandler::ServiceWorkerControlleeRequestHandler(
request_context_type_(request_context_type),
frame_type_(frame_type),
body_(body),
- weak_factory_(this) {
-}
+ skip_service_worker_(false),
+ weak_factory_(this) {}
ServiceWorkerControlleeRequestHandler::
~ServiceWorkerControlleeRequestHandler() {
@@ -86,7 +86,10 @@ 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)
- if (job_.get() && job_->ShouldFallbackToNetwork()) {
+ // 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.
michaeln 2015/08/07 19:40:23 Whoa, this can't be right? User clicks link to bi
horo 2015/08/08 09:00:44 Yes you are right! Navigation request's redirect
+ if ((job_.get() && job_->ShouldFallbackToNetwork()) || skip_service_worker_) {
+ skip_service_worker_ = true;
job_ = NULL;
return NULL;
}
« no previous file with comments | « content/browser/service_worker/service_worker_controllee_request_handler.h ('k') | content/child/web_url_loader_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698