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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 ServiceWorkerProviderHost::CreateRequestHandler( | 147 ServiceWorkerProviderHost::CreateRequestHandler( |
148 ResourceType resource_type, | 148 ResourceType resource_type, |
149 base::WeakPtr<storage::BlobStorageContext> blob_storage_context, | 149 base::WeakPtr<storage::BlobStorageContext> blob_storage_context, |
150 scoped_refptr<ResourceRequestBody> body) { | 150 scoped_refptr<ResourceRequestBody> body) { |
151 if (IsHostToRunningServiceWorker()) { | 151 if (IsHostToRunningServiceWorker()) { |
152 return scoped_ptr<ServiceWorkerRequestHandler>( | 152 return scoped_ptr<ServiceWorkerRequestHandler>( |
153 new ServiceWorkerContextRequestHandler( | 153 new ServiceWorkerContextRequestHandler( |
154 context_, AsWeakPtr(), blob_storage_context, resource_type)); | 154 context_, AsWeakPtr(), blob_storage_context, resource_type)); |
155 } | 155 } |
156 if (ServiceWorkerUtils::IsMainResourceType(resource_type) || | 156 if (ServiceWorkerUtils::IsMainResourceType(resource_type) || |
157 active_version()) { | 157 controlling_version()) { |
158 return scoped_ptr<ServiceWorkerRequestHandler>( | 158 return scoped_ptr<ServiceWorkerRequestHandler>( |
159 new ServiceWorkerControlleeRequestHandler( | 159 new ServiceWorkerControlleeRequestHandler( |
160 context_, AsWeakPtr(), blob_storage_context, resource_type, body)); | 160 context_, AsWeakPtr(), blob_storage_context, resource_type, body)); |
161 } | 161 } |
162 return scoped_ptr<ServiceWorkerRequestHandler>(); | 162 return scoped_ptr<ServiceWorkerRequestHandler>(); |
163 } | 163 } |
164 | 164 |
165 bool ServiceWorkerProviderHost::CanAssociateRegistration( | 165 bool ServiceWorkerProviderHost::CanAssociateRegistration( |
166 ServiceWorkerRegistration* registration) { | 166 ServiceWorkerRegistration* registration) { |
167 if (!context_) | 167 if (!context_) |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 context_->process_manager()->RemoveProcessReferenceFromPattern( | 228 context_->process_manager()->RemoveProcessReferenceFromPattern( |
229 pattern, process_id_); | 229 pattern, process_id_); |
230 } | 230 } |
231 } | 231 } |
232 | 232 |
233 bool ServiceWorkerProviderHost::IsContextAlive() { | 233 bool ServiceWorkerProviderHost::IsContextAlive() { |
234 return context_ != NULL; | 234 return context_ != NULL; |
235 } | 235 } |
236 | 236 |
237 } // namespace content | 237 } // namespace content |
OLD | NEW |