| 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_context_request_handler.
h" | 5 #include "content/browser/service_worker/service_worker_context_request_handler.
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_provider_host.h" | 8 #include "content/browser/service_worker/service_worker_provider_host.h" |
| 9 #include "content/browser/service_worker/service_worker_read_from_cache_job.h" | 9 #include "content/browser/service_worker/service_worker_read_from_cache_job.h" |
| 10 #include "content/browser/service_worker/service_worker_storage.h" | 10 #include "content/browser/service_worker/service_worker_storage.h" |
| 11 #include "content/browser/service_worker/service_worker_version.h" | 11 #include "content/browser/service_worker/service_worker_version.h" |
| 12 #include "content/browser/service_worker/service_worker_write_to_cache_job.h" | 12 #include "content/browser/service_worker/service_worker_write_to_cache_job.h" |
| 13 #include "net/base/load_flags.h" | 13 #include "net/base/load_flags.h" |
| 14 #include "net/url_request/url_request.h" | 14 #include "net/url_request/url_request.h" |
| 15 | 15 |
| 16 namespace content { | 16 namespace content { |
| 17 | 17 |
| 18 ServiceWorkerContextRequestHandler::ServiceWorkerContextRequestHandler( | 18 ServiceWorkerContextRequestHandler::ServiceWorkerContextRequestHandler( |
| 19 base::WeakPtr<ServiceWorkerContextCore> context, | 19 base::WeakPtr<ServiceWorkerContextCore> context, |
| 20 base::WeakPtr<ServiceWorkerProviderHost> provider_host, | 20 base::WeakPtr<ServiceWorkerProviderHost> provider_host, |
| 21 base::WeakPtr<webkit_blob::BlobStorageContext> blob_storage_context, | 21 base::WeakPtr<storage::BlobStorageContext> blob_storage_context, |
| 22 ResourceType resource_type) | 22 ResourceType resource_type) |
| 23 : ServiceWorkerRequestHandler(context, | 23 : ServiceWorkerRequestHandler(context, |
| 24 provider_host, | 24 provider_host, |
| 25 blob_storage_context, | 25 blob_storage_context, |
| 26 resource_type), | 26 resource_type), |
| 27 version_(provider_host_->running_hosted_version()) { | 27 version_(provider_host_->running_hosted_version()) { |
| 28 DCHECK(provider_host_->IsHostToRunningServiceWorker()); | 28 DCHECK(provider_host_->IsHostToRunningServiceWorker()); |
| 29 } | 29 } |
| 30 | 30 |
| 31 ServiceWorkerContextRequestHandler::~ServiceWorkerContextRequestHandler() { | 31 ServiceWorkerContextRequestHandler::~ServiceWorkerContextRequestHandler() { |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 const GURL& url, int64* response_id_out) { | 109 const GURL& url, int64* response_id_out) { |
| 110 // We don't read from the script cache until the version is INSTALLED. | 110 // We don't read from the script cache until the version is INSTALLED. |
| 111 if (version_->status() == ServiceWorkerVersion::NEW || | 111 if (version_->status() == ServiceWorkerVersion::NEW || |
| 112 version_->status() == ServiceWorkerVersion::INSTALLING) | 112 version_->status() == ServiceWorkerVersion::INSTALLING) |
| 113 return false; | 113 return false; |
| 114 *response_id_out = version_->script_cache_map()->Lookup(url); | 114 *response_id_out = version_->script_cache_map()->Lookup(url); |
| 115 return *response_id_out != kInvalidServiceWorkerResponseId; | 115 return *response_id_out != kInvalidServiceWorkerResponseId; |
| 116 } | 116 } |
| 117 | 117 |
| 118 } // namespace content | 118 } // namespace content |
| OLD | NEW |