| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/browser/service_worker/service_worker_controllee_request_handl
er.h" | 5 #include "content/browser/service_worker/service_worker_controllee_request_handl
er.h" |
| 6 | 6 |
| 7 #include "content/browser/service_worker/service_worker_context_core.h" | 7 #include "content/browser/service_worker/service_worker_context_core.h" |
| 8 #include "content/browser/service_worker/service_worker_metrics.h" | 8 #include "content/browser/service_worker/service_worker_metrics.h" |
| 9 #include "content/browser/service_worker/service_worker_provider_host.h" | 9 #include "content/browser/service_worker/service_worker_provider_host.h" |
| 10 #include "content/browser/service_worker/service_worker_registration.h" | 10 #include "content/browser/service_worker/service_worker_registration.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 | 48 |
| 49 net::URLRequestJob* ServiceWorkerControlleeRequestHandler::MaybeCreateJob( | 49 net::URLRequestJob* ServiceWorkerControlleeRequestHandler::MaybeCreateJob( |
| 50 net::URLRequest* request, | 50 net::URLRequest* request, |
| 51 net::NetworkDelegate* network_delegate) { | 51 net::NetworkDelegate* network_delegate) { |
| 52 if (!context_ || !provider_host_) { | 52 if (!context_ || !provider_host_) { |
| 53 // We can't do anything other than to fall back to network. | 53 // We can't do anything other than to fall back to network. |
| 54 job_ = NULL; | 54 job_ = NULL; |
| 55 return NULL; | 55 return NULL; |
| 56 } | 56 } |
| 57 | 57 |
| 58 if (request->load_flags() & net::LOAD_BYPASS_CACHE) { | 58 if (request->load_flags() & net::LOAD_SKIP_SERVICE_WORKER) { |
| 59 if (is_main_resource_load_) { | 59 if (is_main_resource_load_) { |
| 60 provider_host_->SetDocumentUrl( | 60 provider_host_->SetDocumentUrl( |
| 61 net::SimplifyUrlForRequest(request->url())); | 61 net::SimplifyUrlForRequest(request->url())); |
| 62 } | 62 } |
| 63 job_ = NULL; | 63 job_ = NULL; |
| 64 return NULL; | 64 return NULL; |
| 65 } | 65 } |
| 66 | 66 |
| 67 // This may get called multiple times for original and redirect requests: | 67 // This may get called multiple times for original and redirect requests: |
| 68 // A. original request case: job_ is null, no previous location info. | 68 // A. original request case: job_ is null, no previous location info. |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 } | 185 } |
| 186 | 186 |
| 187 void ServiceWorkerControlleeRequestHandler::PrepareForSubResource() { | 187 void ServiceWorkerControlleeRequestHandler::PrepareForSubResource() { |
| 188 DCHECK(job_.get()); | 188 DCHECK(job_.get()); |
| 189 DCHECK(context_); | 189 DCHECK(context_); |
| 190 DCHECK(provider_host_->active_version()); | 190 DCHECK(provider_host_->active_version()); |
| 191 job_->ForwardToServiceWorker(); | 191 job_->ForwardToServiceWorker(); |
| 192 } | 192 } |
| 193 | 193 |
| 194 } // namespace content | 194 } // namespace content |
| OLD | NEW |