| 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 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 message, | 218 message, |
| 219 sent_message_port_ids, | 219 sent_message_port_ids, |
| 220 new_routing_ids)); | 220 new_routing_ids)); |
| 221 } | 221 } |
| 222 | 222 |
| 223 ServiceWorkerObjectInfo ServiceWorkerProviderHost::CreateHandleAndPass( | 223 ServiceWorkerObjectInfo ServiceWorkerProviderHost::CreateHandleAndPass( |
| 224 ServiceWorkerVersion* version) { | 224 ServiceWorkerVersion* version) { |
| 225 ServiceWorkerObjectInfo info; | 225 ServiceWorkerObjectInfo info; |
| 226 if (context_ && version) { | 226 if (context_ && version) { |
| 227 scoped_ptr<ServiceWorkerHandle> handle = | 227 scoped_ptr<ServiceWorkerHandle> handle = |
| 228 ServiceWorkerHandle::Create(context_, dispatcher_host_, | 228 ServiceWorkerHandle::Create(context_, |
| 229 kDocumentMainThreadId, version); | 229 dispatcher_host_, |
| 230 kDocumentMainThreadId, |
| 231 provider_id_, |
| 232 version); |
| 230 info = handle->GetObjectInfo(); | 233 info = handle->GetObjectInfo(); |
| 231 dispatcher_host_->RegisterServiceWorkerHandle(handle.Pass()); | 234 dispatcher_host_->RegisterServiceWorkerHandle(handle.Pass()); |
| 232 } | 235 } |
| 233 return info; | 236 return info; |
| 234 } | 237 } |
| 235 | 238 |
| 236 bool ServiceWorkerProviderHost::IsContextAlive() { | 239 bool ServiceWorkerProviderHost::IsContextAlive() { |
| 237 return context_ != NULL; | 240 return context_ != NULL; |
| 238 } | 241 } |
| 239 | 242 |
| 240 } // namespace content | 243 } // namespace content |
| OLD | NEW |