| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/service_worker/worker_fetch_context_impl.h" | 5 #include "content/renderer/service_worker/worker_fetch_context_impl.h" |
| 6 | 6 |
| 7 #include "content/child/request_extra_data.h" | 7 #include "content/child/request_extra_data.h" |
| 8 #include "content/child/resource_dispatcher.h" | 8 #include "content/child/resource_dispatcher.h" |
| 9 #include "content/child/web_url_loader_impl.h" | 9 #include "content/child/web_url_loader_impl.h" |
| 10 #include "mojo/public/cpp/bindings/associated_binding.h" | 10 #include "mojo/public/cpp/bindings/associated_binding.h" |
| 11 | 11 |
| 12 namespace content { | 12 namespace content { |
| 13 | 13 |
| 14 WorkerFetchContextImpl::WorkerFetchContextImpl( | 14 WorkerFetchContextImpl::WorkerFetchContextImpl( |
| 15 mojom::WorkerURLLoaderFactoryProviderPtrInfo provider_info) | 15 mojom::WorkerURLLoaderFactoryProviderPtrInfo provider_info) |
| 16 : provider_info_(std::move(provider_info)) {} | 16 : provider_info_(std::move(provider_info)) {} |
| 17 | 17 |
| 18 WorkerFetchContextImpl::~WorkerFetchContextImpl() {} | 18 WorkerFetchContextImpl::~WorkerFetchContextImpl() {} |
| 19 | 19 |
| 20 void WorkerFetchContextImpl::InitializeOnWorkerThread( | 20 void WorkerFetchContextImpl::InitializeOnWorkerThread( |
| 21 base::SingleThreadTaskRunner* loading_task_runner) { | 21 base::SingleThreadTaskRunner* loading_task_runner) { |
| 22 DCHECK(loading_task_runner->RunsTasksOnCurrentThread()); | 22 DCHECK(loading_task_runner->RunsTasksInCurrentSequence()); |
| 23 DCHECK(!resource_dispatcher_); | 23 DCHECK(!resource_dispatcher_); |
| 24 DCHECK(!binding_); | 24 DCHECK(!binding_); |
| 25 resource_dispatcher_ = | 25 resource_dispatcher_ = |
| 26 base::MakeUnique<ResourceDispatcher>(nullptr, loading_task_runner); | 26 base::MakeUnique<ResourceDispatcher>(nullptr, loading_task_runner); |
| 27 binding_ = base::MakeUnique< | 27 binding_ = base::MakeUnique< |
| 28 mojo::AssociatedBinding<mojom::ServiceWorkerWorkerClient>>(this); | 28 mojo::AssociatedBinding<mojom::ServiceWorkerWorkerClient>>(this); |
| 29 DCHECK(provider_info_.is_valid()); | 29 DCHECK(provider_info_.is_valid()); |
| 30 provider_.Bind(std::move(provider_info_)); | 30 provider_.Bind(std::move(provider_info_)); |
| 31 mojom::ServiceWorkerWorkerClientAssociatedPtrInfo ptr_info; | 31 mojom::ServiceWorkerWorkerClientAssociatedPtrInfo ptr_info; |
| 32 binding_->Bind(&ptr_info); | 32 binding_->Bind(&ptr_info); |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 void WorkerFetchContextImpl::set_is_controlled_by_service_worker(bool flag) { | 65 void WorkerFetchContextImpl::set_is_controlled_by_service_worker(bool flag) { |
| 66 is_controlled_by_service_worker_ = flag; | 66 is_controlled_by_service_worker_ = flag; |
| 67 } | 67 } |
| 68 | 68 |
| 69 void WorkerFetchContextImpl::SetControllerServiceWorker( | 69 void WorkerFetchContextImpl::SetControllerServiceWorker( |
| 70 int64_t controller_version_id) { | 70 int64_t controller_version_id) { |
| 71 controller_version_id_ = controller_version_id; | 71 controller_version_id_ = controller_version_id; |
| 72 } | 72 } |
| 73 | 73 |
| 74 } // namespace content | 74 } // namespace content |
| OLD | NEW |