| 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 "base/trace_event/trace_event.h" | 7 #include "base/trace_event/trace_event.h" |
| 8 #include "content/browser/service_worker/service_worker_context_core.h" | 8 #include "content/browser/service_worker/service_worker_context_core.h" |
| 9 #include "content/browser/service_worker/service_worker_metrics.h" | 9 #include "content/browser/service_worker/service_worker_metrics.h" |
| 10 #include "content/browser/service_worker/service_worker_provider_host.h" | 10 #include "content/browser/service_worker/service_worker_provider_host.h" |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 TRACE_EVENT_ASYNC_END1( | 176 TRACE_EVENT_ASYNC_END1( |
| 177 "ServiceWorker", | 177 "ServiceWorker", |
| 178 "ServiceWorkerControlleeRequestHandler::PrepareForMainResource", | 178 "ServiceWorkerControlleeRequestHandler::PrepareForMainResource", |
| 179 job_.get(), | 179 job_.get(), |
| 180 "Status", status); | 180 "Status", status); |
| 181 return; | 181 return; |
| 182 } | 182 } |
| 183 DCHECK(registration.get()); | 183 DCHECK(registration.get()); |
| 184 | 184 |
| 185 if (!GetContentClient()->browser()->AllowServiceWorker( | 185 if (!GetContentClient()->browser()->AllowServiceWorker( |
| 186 registration->pattern(), | 186 registration->pattern(), provider_host_->topmost_frame_url(), |
| 187 provider_host_->topmost_frame_url(), | 187 resource_context_, provider_host_->process_id(), |
| 188 resource_context_)) { | 188 provider_host_->frame_id())) { |
| 189 job_->FallbackToNetwork(); | 189 job_->FallbackToNetwork(); |
| 190 TRACE_EVENT_ASYNC_END2( | 190 TRACE_EVENT_ASYNC_END2( |
| 191 "ServiceWorker", | 191 "ServiceWorker", |
| 192 "ServiceWorkerControlleeRequestHandler::PrepareForMainResource", | 192 "ServiceWorkerControlleeRequestHandler::PrepareForMainResource", |
| 193 job_.get(), | 193 job_.get(), |
| 194 "Status", status, | 194 "Status", status, |
| 195 "Info", "ServiceWorker is blocked"); | 195 "Info", "ServiceWorker is blocked"); |
| 196 return; | 196 return; |
| 197 } | 197 } |
| 198 | 198 |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 } | 271 } |
| 272 | 272 |
| 273 void ServiceWorkerControlleeRequestHandler::PrepareForSubResource() { | 273 void ServiceWorkerControlleeRequestHandler::PrepareForSubResource() { |
| 274 DCHECK(job_.get()); | 274 DCHECK(job_.get()); |
| 275 DCHECK(context_); | 275 DCHECK(context_); |
| 276 DCHECK(provider_host_->active_version()); | 276 DCHECK(provider_host_->active_version()); |
| 277 job_->ForwardToServiceWorker(); | 277 job_->ForwardToServiceWorker(); |
| 278 } | 278 } |
| 279 | 279 |
| 280 } // namespace content | 280 } // namespace content |
| OLD | NEW |