| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_provider_host.h" | 5 #include "content/browser/service_worker/service_worker_provider_host.h" |
| 6 | 6 |
| 7 #include "base/stl_util.h" | 7 #include "base/stl_util.h" |
| 8 #include "content/browser/message_port_message_filter.h" | 8 #include "content/browser/message_port_message_filter.h" |
| 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_request_handler.
h" | 10 #include "content/browser/service_worker/service_worker_context_request_handler.
h" |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 if (!associated_registration_) | 180 if (!associated_registration_) |
| 181 return; | 181 return; |
| 182 associated_registration_->RemoveListener(this); | 182 associated_registration_->RemoveListener(this); |
| 183 associated_registration_ = NULL; | 183 associated_registration_ = NULL; |
| 184 ClearVersionAttributes(); | 184 ClearVersionAttributes(); |
| 185 } | 185 } |
| 186 | 186 |
| 187 scoped_ptr<ServiceWorkerRequestHandler> | 187 scoped_ptr<ServiceWorkerRequestHandler> |
| 188 ServiceWorkerProviderHost::CreateRequestHandler( | 188 ServiceWorkerProviderHost::CreateRequestHandler( |
| 189 ResourceType resource_type, | 189 ResourceType resource_type, |
| 190 base::WeakPtr<webkit_blob::BlobStorageContext> blob_storage_context, | 190 base::WeakPtr<storage::BlobStorageContext> blob_storage_context, |
| 191 scoped_refptr<ResourceRequestBody> body) { | 191 scoped_refptr<ResourceRequestBody> body) { |
| 192 if (IsHostToRunningServiceWorker()) { | 192 if (IsHostToRunningServiceWorker()) { |
| 193 return scoped_ptr<ServiceWorkerRequestHandler>( | 193 return scoped_ptr<ServiceWorkerRequestHandler>( |
| 194 new ServiceWorkerContextRequestHandler( | 194 new ServiceWorkerContextRequestHandler( |
| 195 context_, AsWeakPtr(), blob_storage_context, resource_type)); | 195 context_, AsWeakPtr(), blob_storage_context, resource_type)); |
| 196 } | 196 } |
| 197 if (ServiceWorkerUtils::IsMainResourceType(resource_type) || | 197 if (ServiceWorkerUtils::IsMainResourceType(resource_type) || |
| 198 active_version()) { | 198 active_version()) { |
| 199 return scoped_ptr<ServiceWorkerRequestHandler>( | 199 return scoped_ptr<ServiceWorkerRequestHandler>( |
| 200 new ServiceWorkerControlleeRequestHandler( | 200 new ServiceWorkerControlleeRequestHandler( |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 dispatcher_host_->RegisterServiceWorkerHandle(handle.Pass()); | 247 dispatcher_host_->RegisterServiceWorkerHandle(handle.Pass()); |
| 248 } | 248 } |
| 249 return info; | 249 return info; |
| 250 } | 250 } |
| 251 | 251 |
| 252 bool ServiceWorkerProviderHost::IsContextAlive() { | 252 bool ServiceWorkerProviderHost::IsContextAlive() { |
| 253 return context_ != NULL; | 253 return context_ != NULL; |
| 254 } | 254 } |
| 255 | 255 |
| 256 } // namespace content | 256 } // namespace content |
| OLD | NEW |