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