| 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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) { |
| 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 // A page load with skip_service_worker should be triggered by |
| 84 // shift-reload, so retain all live matching registrations. |
| 85 provider_host->AddAllMatchingRegistrations(); |
| 83 } | 86 } |
| 84 return; | 87 return; |
| 85 } | 88 } |
| 86 | 89 |
| 87 scoped_ptr<ServiceWorkerRequestHandler> handler( | 90 scoped_ptr<ServiceWorkerRequestHandler> handler( |
| 88 provider_host->CreateRequestHandler(request_mode, | 91 provider_host->CreateRequestHandler(request_mode, |
| 89 credentials_mode, | 92 credentials_mode, |
| 90 resource_type, | 93 resource_type, |
| 91 request_context_type, | 94 request_context_type, |
| 92 frame_type, | 95 frame_type, |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 ResourceType resource_type) | 166 ResourceType resource_type) |
| 164 : context_(context), | 167 : context_(context), |
| 165 provider_host_(provider_host), | 168 provider_host_(provider_host), |
| 166 blob_storage_context_(blob_storage_context), | 169 blob_storage_context_(blob_storage_context), |
| 167 resource_type_(resource_type), | 170 resource_type_(resource_type), |
| 168 old_process_id_(0), | 171 old_process_id_(0), |
| 169 old_provider_id_(kInvalidServiceWorkerProviderId) { | 172 old_provider_id_(kInvalidServiceWorkerProviderId) { |
| 170 } | 173 } |
| 171 | 174 |
| 172 } // namespace content | 175 } // namespace content |
| OLD | NEW |