Chromium Code Reviews| 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..93e593862e089995adcf22d7cd3d98d0abd82d53 100644 |
| --- a/content/browser/service_worker/service_worker_controllee_request_handler.cc |
| +++ b/content/browser/service_worker/service_worker_controllee_request_handler.cc |
| @@ -86,11 +86,8 @@ 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; |
| - job_ = NULL; |
| + FallbackToNetwork(); |
| return NULL; |
| } |
| @@ -112,7 +109,7 @@ net::URLRequestJob* ServiceWorkerControlleeRequestHandler::MaybeCreateJob( |
| // If we know we can fallback to network at this point (in case |
| // the storage lookup returned immediately), just return NULL here to |
| // fallback to network. |
| - job_ = NULL; |
| + FallbackToNetwork(); |
| return NULL; |
| } |
| @@ -276,4 +273,13 @@ void ServiceWorkerControlleeRequestHandler::PrepareForSubResource() { |
| job_->ForwardToServiceWorker(); |
| } |
| +void ServiceWorkerControlleeRequestHandler::FallbackToNetwork() { |
| + // Once a subresource request was fallbacked to the network, we set |
| + // |skip_service_worker_| and the request shoud not go to the service |
|
falken
2015/08/10 07:05:59
nit: and -> because (?)
nit: shoud -> should
horo
2015/08/10 07:23:56
Done.
|
| + // worker. |
| + if (!is_main_resource_load_) |
| + skip_service_worker_ = true; |
| + job_ = NULL; |
| +} |
| + |
| } // namespace content |