| 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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 // something is amiss. | 154 // something is amiss. |
| 155 return false; | 155 return false; |
| 156 } | 156 } |
| 157 | 157 |
| 158 running_hosted_version_ = live_version; | 158 running_hosted_version_ = live_version; |
| 159 return true; | 159 return true; |
| 160 } | 160 } |
| 161 | 161 |
| 162 scoped_ptr<ServiceWorkerRequestHandler> | 162 scoped_ptr<ServiceWorkerRequestHandler> |
| 163 ServiceWorkerProviderHost::CreateRequestHandler( | 163 ServiceWorkerProviderHost::CreateRequestHandler( |
| 164 ResourceType::Type resource_type, | 164 ResourceType resource_type, |
| 165 base::WeakPtr<webkit_blob::BlobStorageContext> blob_storage_context) { | 165 base::WeakPtr<webkit_blob::BlobStorageContext> blob_storage_context) { |
| 166 if (IsHostToRunningServiceWorker()) { | 166 if (IsHostToRunningServiceWorker()) { |
| 167 return scoped_ptr<ServiceWorkerRequestHandler>( | 167 return scoped_ptr<ServiceWorkerRequestHandler>( |
| 168 new ServiceWorkerContextRequestHandler( | 168 new ServiceWorkerContextRequestHandler( |
| 169 context_, AsWeakPtr(), blob_storage_context, resource_type)); | 169 context_, AsWeakPtr(), blob_storage_context, resource_type)); |
| 170 } | 170 } |
| 171 if (ServiceWorkerUtils::IsMainResourceType(resource_type) || | 171 if (ServiceWorkerUtils::IsMainResourceType(resource_type) || |
| 172 active_version()) { | 172 active_version()) { |
| 173 return scoped_ptr<ServiceWorkerRequestHandler>( | 173 return scoped_ptr<ServiceWorkerRequestHandler>( |
| 174 new ServiceWorkerControlleeRequestHandler( | 174 new ServiceWorkerControlleeRequestHandler( |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 dispatcher_host_->RegisterServiceWorkerHandle(handle.Pass()); | 231 dispatcher_host_->RegisterServiceWorkerHandle(handle.Pass()); |
| 232 } | 232 } |
| 233 return info; | 233 return info; |
| 234 } | 234 } |
| 235 | 235 |
| 236 bool ServiceWorkerProviderHost::IsContextAlive() { | 236 bool ServiceWorkerProviderHost::IsContextAlive() { |
| 237 return context_ != NULL; | 237 return context_ != NULL; |
| 238 } | 238 } |
| 239 | 239 |
| 240 } // namespace content | 240 } // namespace content |
| OLD | NEW |