Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(387)

Side by Side Diff: content/renderer/service_worker/service_worker_context_client.cc

Issue 2396273002: ServiceWorker: Mojofication of ServiceWorkerDispatcherHost (Closed)
Patch Set: Removed GetWeakPtr and moved a method to private Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/public/app/mojo/content_browser_manifest.json ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/service_worker_context_client.h" 5 #include "content/renderer/service_worker/service_worker_context_client.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after
648 context_->sync_event_callbacks.Remove(request_id); 648 context_->sync_event_callbacks.Remove(request_id);
649 } 649 }
650 650
651 blink::WebServiceWorkerNetworkProvider* 651 blink::WebServiceWorkerNetworkProvider*
652 ServiceWorkerContextClient::createServiceWorkerNetworkProvider( 652 ServiceWorkerContextClient::createServiceWorkerNetworkProvider(
653 blink::WebDataSource* data_source) { 653 blink::WebDataSource* data_source) {
654 DCHECK(main_thread_task_runner_->RunsTasksOnCurrentThread()); 654 DCHECK(main_thread_task_runner_->RunsTasksOnCurrentThread());
655 655
656 // Create a content::ServiceWorkerNetworkProvider for this data source so 656 // Create a content::ServiceWorkerNetworkProvider for this data source so
657 // we can observe its requests. 657 // we can observe its requests.
658 std::unique_ptr<ServiceWorkerNetworkProvider> provider( 658 std::unique_ptr<ServiceWorkerNetworkProvider> provider =
659 new ServiceWorkerNetworkProvider(MSG_ROUTING_NONE, 659 base::MakeUnique<ServiceWorkerNetworkProvider>(
660 SERVICE_WORKER_PROVIDER_FOR_CONTROLLER, 660 MSG_ROUTING_NONE, SERVICE_WORKER_PROVIDER_FOR_CONTROLLER,
661 true /* is_parent_frame_secure */)); 661 true /* is_parent_frame_secure */);
662 provider_context_ = provider->context(); 662 provider_context_ = provider->context();
663 663
664 // Tell the network provider about which version to load. 664 // Tell the network provider about which version to load.
665 provider->SetServiceWorkerVersionId(service_worker_version_id_, 665 provider->SetServiceWorkerVersionId(service_worker_version_id_,
666 embedded_worker_id_); 666 embedded_worker_id_);
667 667
668 // The provider is kept around for the lifetime of the DataSource 668 // The provider is kept around for the lifetime of the DataSource
669 // and ownership is transferred to the DataSource. 669 // and ownership is transferred to the DataSource.
670 DataSourceExtraData* extra_data = new DataSourceExtraData(); 670 DataSourceExtraData* extra_data = new DataSourceExtraData();
671 data_source->setExtraData(extra_data); 671 data_source->setExtraData(extra_data);
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
1104 } 1104 }
1105 1105
1106 base::WeakPtr<ServiceWorkerContextClient> 1106 base::WeakPtr<ServiceWorkerContextClient>
1107 ServiceWorkerContextClient::GetWeakPtr() { 1107 ServiceWorkerContextClient::GetWeakPtr() {
1108 DCHECK(worker_task_runner_->RunsTasksOnCurrentThread()); 1108 DCHECK(worker_task_runner_->RunsTasksOnCurrentThread());
1109 DCHECK(context_); 1109 DCHECK(context_);
1110 return context_->weak_factory.GetWeakPtr(); 1110 return context_->weak_factory.GetWeakPtr();
1111 } 1111 }
1112 1112
1113 } // namespace content 1113 } // namespace content
OLDNEW
« no previous file with comments | « content/public/app/mojo/content_browser_manifest.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698