Index: content/child/service_worker/service_worker_network_provider.cc |
diff --git a/content/child/service_worker/service_worker_network_provider.cc b/content/child/service_worker/service_worker_network_provider.cc |
index 8372661ebc3373f98b007dff237fb3e6eb9881f0..311f3cbbb01ca2c2231c39ef0bd9916f09ed89fe 100644 |
--- a/content/child/service_worker/service_worker_network_provider.cc |
+++ b/content/child/service_worker/service_worker_network_provider.cc |
@@ -15,6 +15,7 @@ |
#include "content/common/service_worker/service_worker_utils.h" |
#include "content/public/common/browser_side_navigation_policy.h" |
#include "ipc/ipc_sync_channel.h" |
+#include "mojo/public/cpp/bindings/associated_group.h" |
#include "third_party/WebKit/public/platform/WebSecurityOrigin.h" |
#include "third_party/WebKit/public/platform/modules/serviceworker/WebServiceWorkerNetworkProvider.h" |
#include "third_party/WebKit/public/web/WebLocalFrame.h" |
@@ -174,14 +175,21 @@ ServiceWorkerNetworkProvider::ServiceWorkerNetworkProvider( |
return; |
if (!ChildThreadImpl::current()) |
return; // May be null in some tests. |
- ServiceWorkerProviderHostInfo provider_info( |
- provider_id_, route_id, provider_type, is_parent_frame_secure); |
+ |
+ ServiceWorkerProviderHostInfo host_info(provider_id_, route_id, provider_type, |
+ is_parent_frame_secure); |
+ host_info.host_request = mojo::MakeRequest(&provider_host_); |
+ mojom::ServiceWorkerProviderAssociatedRequest client_request = |
+ mojo::MakeRequest(&host_info.client_ptr_info); |
+ |
+ DCHECK(host_info.host_request.is_pending()); |
+ DCHECK(host_info.host_request.handle().is_valid()); |
context_ = new ServiceWorkerProviderContext( |
- provider_id_, provider_type, |
+ provider_id_, provider_type, std::move(client_request), |
ChildThreadImpl::current()->thread_safe_sender()); |
ChildThreadImpl::current()->channel()->GetRemoteAssociatedInterface( |
&dispatcher_host_); |
- dispatcher_host_->OnProviderCreated(std::move(provider_info)); |
+ dispatcher_host_->OnProviderCreated(std::move(host_info)); |
} |
ServiceWorkerNetworkProvider::ServiceWorkerNetworkProvider( |
@@ -201,7 +209,7 @@ ServiceWorkerNetworkProvider::~ServiceWorkerNetworkProvider() { |
return; |
if (!ChildThreadImpl::current()) |
return; // May be null in some tests. |
- dispatcher_host_->OnProviderDestroyed(provider_id()); |
+ provider_host_.reset(); |
} |
void ServiceWorkerNetworkProvider::SetServiceWorkerVersionId( |