| 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/renderer/shared_worker/embedded_shared_worker_stub.h" | 5 #include "content/renderer/shared_worker/embedded_shared_worker_stub.h" |
| 6 | 6 |
| 7 #include "base/thread_task_runner_handle.h" | 7 #include "base/thread_task_runner_handle.h" |
| 8 #include "content/child/appcache/appcache_dispatcher.h" | 8 #include "content/child/appcache/appcache_dispatcher.h" |
| 9 #include "content/child/appcache/web_application_cache_host_impl.h" | 9 #include "content/child/appcache/web_application_cache_host_impl.h" |
| 10 #include "content/child/request_extra_data.h" | 10 #include "content/child/request_extra_data.h" |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 ChildThreadImpl::current()->thread_safe_sender()); | 229 ChildThreadImpl::current()->thread_safe_sender()); |
| 230 } | 230 } |
| 231 | 231 |
| 232 blink::WebServiceWorkerNetworkProvider* | 232 blink::WebServiceWorkerNetworkProvider* |
| 233 EmbeddedSharedWorkerStub::createServiceWorkerNetworkProvider( | 233 EmbeddedSharedWorkerStub::createServiceWorkerNetworkProvider( |
| 234 blink::WebDataSource* data_source) { | 234 blink::WebDataSource* data_source) { |
| 235 // Create a content::ServiceWorkerNetworkProvider for this data source so | 235 // Create a content::ServiceWorkerNetworkProvider for this data source so |
| 236 // we can observe its requests. | 236 // we can observe its requests. |
| 237 scoped_ptr<ServiceWorkerNetworkProvider> provider( | 237 scoped_ptr<ServiceWorkerNetworkProvider> provider( |
| 238 new ServiceWorkerNetworkProvider( | 238 new ServiceWorkerNetworkProvider( |
| 239 MSG_ROUTING_NONE, SERVICE_WORKER_PROVIDER_FOR_SHARED_WORKER)); | 239 route_id_, SERVICE_WORKER_PROVIDER_FOR_SHARED_WORKER)); |
| 240 | 240 |
| 241 // The provider is kept around for the lifetime of the DataSource | 241 // The provider is kept around for the lifetime of the DataSource |
| 242 // and ownership is transferred to the DataSource. | 242 // and ownership is transferred to the DataSource. |
| 243 DataSourceExtraData* extra_data = new DataSourceExtraData(); | 243 DataSourceExtraData* extra_data = new DataSourceExtraData(); |
| 244 data_source->setExtraData(extra_data); | 244 data_source->setExtraData(extra_data); |
| 245 ServiceWorkerNetworkProvider::AttachToDocumentState( | 245 ServiceWorkerNetworkProvider::AttachToDocumentState( |
| 246 extra_data, provider.Pass()); | 246 extra_data, provider.Pass()); |
| 247 | 247 |
| 248 // Blink is responsible for deleting the returned object. | 248 // Blink is responsible for deleting the returned object. |
| 249 return new WebServiceWorkerNetworkProviderImpl(); | 249 return new WebServiceWorkerNetworkProviderImpl(); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 } | 291 } |
| 292 } | 292 } |
| 293 | 293 |
| 294 void EmbeddedSharedWorkerStub::OnTerminateWorkerContext() { | 294 void EmbeddedSharedWorkerStub::OnTerminateWorkerContext() { |
| 295 // After this we wouldn't get any IPC for this stub. | 295 // After this we wouldn't get any IPC for this stub. |
| 296 running_ = false; | 296 running_ = false; |
| 297 impl_->terminateWorkerContext(); | 297 impl_->terminateWorkerContext(); |
| 298 } | 298 } |
| 299 | 299 |
| 300 } // namespace content | 300 } // namespace content |
| OLD | NEW |