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 <stdint.h> | 7 #include <stdint.h> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/threading/thread_task_runner_handle.h" | 10 #include "base/threading/thread_task_runner_handle.h" |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 ChildThreadImpl::current()->thread_safe_sender()); | 234 ChildThreadImpl::current()->thread_safe_sender()); |
235 } | 235 } |
236 | 236 |
237 blink::WebServiceWorkerNetworkProvider* | 237 blink::WebServiceWorkerNetworkProvider* |
238 EmbeddedSharedWorkerStub::createServiceWorkerNetworkProvider( | 238 EmbeddedSharedWorkerStub::createServiceWorkerNetworkProvider( |
239 blink::WebDataSource* data_source) { | 239 blink::WebDataSource* data_source) { |
240 // Create a content::ServiceWorkerNetworkProvider for this data source so | 240 // Create a content::ServiceWorkerNetworkProvider for this data source so |
241 // we can observe its requests. | 241 // we can observe its requests. |
242 std::unique_ptr<ServiceWorkerNetworkProvider> provider( | 242 std::unique_ptr<ServiceWorkerNetworkProvider> provider( |
243 new ServiceWorkerNetworkProvider( | 243 new ServiceWorkerNetworkProvider( |
244 route_id_, SERVICE_WORKER_PROVIDER_FOR_SHARED_WORKER, | 244 route_id_, SERVICE_WORKER_PROVIDER_FOR_SHARED_WORKER)); |
245 true /* is_parent_frame_secure */)); | |
246 | 245 |
247 // The provider is kept around for the lifetime of the DataSource | 246 // The provider is kept around for the lifetime of the DataSource |
248 // and ownership is transferred to the DataSource. | 247 // and ownership is transferred to the DataSource. |
249 DataSourceExtraData* extra_data = new DataSourceExtraData(); | 248 DataSourceExtraData* extra_data = new DataSourceExtraData(); |
250 data_source->setExtraData(extra_data); | 249 data_source->setExtraData(extra_data); |
251 ServiceWorkerNetworkProvider::AttachToDocumentState(extra_data, | 250 ServiceWorkerNetworkProvider::AttachToDocumentState(extra_data, |
252 std::move(provider)); | 251 std::move(provider)); |
253 | 252 |
254 // Blink is responsible for deleting the returned object. | 253 // Blink is responsible for deleting the returned object. |
255 return new WebServiceWorkerNetworkProviderImpl(); | 254 return new WebServiceWorkerNetworkProviderImpl(); |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 } | 296 } |
298 } | 297 } |
299 | 298 |
300 void EmbeddedSharedWorkerStub::OnTerminateWorkerContext() { | 299 void EmbeddedSharedWorkerStub::OnTerminateWorkerContext() { |
301 // After this we wouldn't get any IPC for this stub. | 300 // After this we wouldn't get any IPC for this stub. |
302 running_ = false; | 301 running_ = false; |
303 impl_->terminateWorkerContext(); | 302 impl_->terminateWorkerContext(); |
304 } | 303 } |
305 | 304 |
306 } // namespace content | 305 } // namespace content |
OLD | NEW |