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

Unified Diff: content/renderer/service_worker/service_worker_context_client.cc

Issue 2106693002: Convert EmbeddedWorker to InterfaceRegistry/Provider. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/service_worker/service_worker_context_client.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/service_worker/service_worker_context_client.cc
diff --git a/content/renderer/service_worker/service_worker_context_client.cc b/content/renderer/service_worker/service_worker_context_client.cc
index 1985a5e57af8dfd13691aed86f571ccee197da61..484d1a021acf2595ce69199727ddb3ecb0a40dc4 100644
--- a/content/renderer/service_worker/service_worker_context_client.cc
+++ b/content/renderer/service_worker/service_worker_context_client.cc
@@ -176,7 +176,9 @@ struct ServiceWorkerContextClient::WorkerContextData {
IDMapOwnPointer>;
explicit WorkerContextData(ServiceWorkerContextClient* owner)
- : weak_factory(owner), proxy_weak_factory(owner->proxy_) {}
+ : interface_registry(nullptr),
+ weak_factory(owner),
+ proxy_weak_factory(owner->proxy_) {}
~WorkerContextData() {
DCHECK(thread_checker.CalledOnValidThread());
@@ -197,7 +199,8 @@ struct ServiceWorkerContextClient::WorkerContextData {
// Pending callbacks for Background Sync Events
SyncEventCallbacksMap sync_event_callbacks;
- ServiceRegistryImpl service_registry;
+ shell::InterfaceRegistry interface_registry;
+ shell::InterfaceProvider remote_interfaces;
base::ThreadChecker thread_checker;
base::WeakPtrFactory<ServiceWorkerContextClient> weak_factory;
@@ -273,12 +276,11 @@ void ServiceWorkerContextClient::OnMessageReceived(
DCHECK(handled);
}
-void ServiceWorkerContextClient::BindServiceRegistry(
- shell::mojom::InterfaceProviderRequest services,
- shell::mojom::InterfaceProviderPtr exposed_services) {
- context_->service_registry.Bind(std::move(services));
- mojo::FuseInterface(context_->service_registry.TakeRemoteRequest(),
- exposed_services.PassInterface());
+void ServiceWorkerContextClient::BindInterfaceProviders(
+ shell::mojom::InterfaceProviderRequest request,
+ shell::mojom::InterfaceProviderPtr remote_interfaces) {
+ context_->interface_registry.Bind(std::move(request));
+ context_->remote_interfaces.Bind(std::move(remote_interfaces));
}
blink::WebURL ServiceWorkerContextClient::scope() const {
@@ -376,8 +378,8 @@ void ServiceWorkerContextClient::workerContextStarted(
DCHECK_NE(registration_info.registration_id,
kInvalidServiceWorkerRegistrationId);
- // Register Mojo services.
- context_->service_registry.ServiceRegistry::AddService(
+ // Register Mojo interfaces.
+ context_->interface_registry.AddInterface(
base::Bind(&BackgroundSyncClientImpl::Create));
SetRegistrationInServiceWorkerGlobalScope(registration_info, version_attrs);
« no previous file with comments | « content/renderer/service_worker/service_worker_context_client.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698