Chromium Code Reviews| 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_request_handler.h" | 5 #include "content/browser/service_worker/service_worker_request_handler.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "content/browser/service_worker/service_worker_context_core.h" | 9 #include "content/browser/service_worker/service_worker_context_core.h" |
| 10 #include "content/browser/service_worker/service_worker_context_wrapper.h" | 10 #include "content/browser/service_worker/service_worker_context_wrapper.h" |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 69 if (!context_wrapper || !context_wrapper->context() || | 69 if (!context_wrapper || !context_wrapper->context() || |
| 70 provider_id == kInvalidServiceWorkerProviderId) { | 70 provider_id == kInvalidServiceWorkerProviderId) { |
| 71 return; | 71 return; |
| 72 } | 72 } |
| 73 | 73 |
| 74 ServiceWorkerProviderHost* provider_host = | 74 ServiceWorkerProviderHost* provider_host = |
| 75 context_wrapper->context()->GetProviderHost(process_id, provider_id); | 75 context_wrapper->context()->GetProviderHost(process_id, provider_id); |
| 76 if (!provider_host || !provider_host->IsContextAlive()) | 76 if (!provider_host || !provider_host->IsContextAlive()) |
| 77 return; | 77 return; |
| 78 | 78 |
| 79 if (skip_service_worker) { | 79 if (skip_service_worker) { |
|
falken
2015/06/17 15:08:35
Can we come here for something other than force-re
| |
| 80 if (ServiceWorkerUtils::IsMainResourceType(resource_type)) { | 80 if (ServiceWorkerUtils::IsMainResourceType(resource_type)) { |
| 81 provider_host->SetDocumentUrl(net::SimplifyUrlForRequest(request->url())); | 81 provider_host->SetDocumentUrl(net::SimplifyUrlForRequest(request->url())); |
| 82 provider_host->SetTopmostFrameUrl(request->first_party_for_cookies()); | 82 provider_host->SetTopmostFrameUrl(request->first_party_for_cookies()); |
| 83 provider_host->CopyMatchingRegistrations(); | |
| 83 } | 84 } |
| 84 return; | 85 return; |
| 85 } | 86 } |
| 86 | 87 |
| 87 scoped_ptr<ServiceWorkerRequestHandler> handler( | 88 scoped_ptr<ServiceWorkerRequestHandler> handler( |
| 88 provider_host->CreateRequestHandler(request_mode, | 89 provider_host->CreateRequestHandler(request_mode, |
| 89 credentials_mode, | 90 credentials_mode, |
| 90 resource_type, | 91 resource_type, |
| 91 request_context_type, | 92 request_context_type, |
| 92 frame_type, | 93 frame_type, |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 163 ResourceType resource_type) | 164 ResourceType resource_type) |
| 164 : context_(context), | 165 : context_(context), |
| 165 provider_host_(provider_host), | 166 provider_host_(provider_host), |
| 166 blob_storage_context_(blob_storage_context), | 167 blob_storage_context_(blob_storage_context), |
| 167 resource_type_(resource_type), | 168 resource_type_(resource_type), |
| 168 old_process_id_(0), | 169 old_process_id_(0), |
| 169 old_provider_id_(kInvalidServiceWorkerProviderId) { | 170 old_provider_id_(kInvalidServiceWorkerProviderId) { |
| 170 } | 171 } |
| 171 | 172 |
| 172 } // namespace content | 173 } // namespace content |
| OLD | NEW |