| 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 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 return handler->provider_host_->associated_registration() || | 230 return handler->provider_host_->associated_registration() || |
| 231 handler->provider_host_->running_hosted_version(); | 231 handler->provider_host_->running_hosted_version(); |
| 232 } | 232 } |
| 233 | 233 |
| 234 ServiceWorkerProviderHost* ServiceWorkerRequestHandler::GetProviderHost( | 234 ServiceWorkerProviderHost* ServiceWorkerRequestHandler::GetProviderHost( |
| 235 const net::URLRequest* request) { | 235 const net::URLRequest* request) { |
| 236 ServiceWorkerRequestHandler* handler = GetHandler(request); | 236 ServiceWorkerRequestHandler* handler = GetHandler(request); |
| 237 return handler ? handler->provider_host_.get() : nullptr; | 237 return handler ? handler->provider_host_.get() : nullptr; |
| 238 } | 238 } |
| 239 | 239 |
| 240 void ServiceWorkerRequestHandler::MaybeCreateLoaderFactory( | 240 void ServiceWorkerRequestHandler::MaybeCreateLoader( |
| 241 const ResourceRequest& request, | 241 const ResourceRequest& request, |
| 242 ResourceContext* resource_context, | 242 ResourceContext* resource_context, |
| 243 LoaderFactoryCallback callback) { | 243 LoaderCallback callback) { |
| 244 NOTREACHED(); | 244 NOTREACHED(); |
| 245 std::move(callback).Run(nullptr); | 245 std::move(callback).Run(StartLoaderCallback()); |
| 246 } | 246 } |
| 247 | 247 |
| 248 void ServiceWorkerRequestHandler::PrepareForCrossSiteTransfer( | 248 void ServiceWorkerRequestHandler::PrepareForCrossSiteTransfer( |
| 249 int old_process_id) { | 249 int old_process_id) { |
| 250 CHECK(!IsBrowserSideNavigationEnabled()); | 250 CHECK(!IsBrowserSideNavigationEnabled()); |
| 251 if (!provider_host_ || !context_) | 251 if (!provider_host_ || !context_) |
| 252 return; | 252 return; |
| 253 old_process_id_ = old_process_id; | 253 old_process_id_ = old_process_id; |
| 254 old_provider_id_ = provider_host_->provider_id(); | 254 old_provider_id_ = provider_host_->provider_id(); |
| 255 host_for_cross_site_transfer_ = context_->TransferProviderHostOut( | 255 host_for_cross_site_transfer_ = context_->TransferProviderHostOut( |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 ResourceType resource_type) | 295 ResourceType resource_type) |
| 296 : context_(context), | 296 : context_(context), |
| 297 provider_host_(provider_host), | 297 provider_host_(provider_host), |
| 298 blob_storage_context_(blob_storage_context), | 298 blob_storage_context_(blob_storage_context), |
| 299 resource_type_(resource_type), | 299 resource_type_(resource_type), |
| 300 old_process_id_(0), | 300 old_process_id_(0), |
| 301 old_provider_id_(kInvalidServiceWorkerProviderId) { | 301 old_provider_id_(kInvalidServiceWorkerProviderId) { |
| 302 } | 302 } |
| 303 | 303 |
| 304 } // namespace content | 304 } // namespace content |
| OLD | NEW |