Index: content/browser/service_worker/service_worker_test_utils.cc |
diff --git a/content/browser/service_worker/service_worker_test_utils.cc b/content/browser/service_worker/service_worker_test_utils.cc |
index e8439101dd33ce12e128c5005ef8c940b7ee76a6..d5aa8c3de1520b6fdc34388e254285f08e4bc93b 100644 |
--- a/content/browser/service_worker/service_worker_test_utils.cc |
+++ b/content/browser/service_worker/service_worker_test_utils.cc |
@@ -10,14 +10,32 @@ |
namespace content { |
+ServiceWorkerRemoteProviderEndpoint::ServiceWorkerRemoteProviderEndpoint() {} |
+ServiceWorkerRemoteProviderEndpoint::ServiceWorkerRemoteProviderEndpoint( |
+ ServiceWorkerRemoteProviderEndpoint&& other) |
+ : host_ptr_(std::move(other.host_ptr_)), |
+ client_request_(std::move(other.client_request_)) {} |
+ |
+ServiceWorkerRemoteProviderEndpoint::~ServiceWorkerRemoteProviderEndpoint() {} |
+ |
+void ServiceWorkerRemoteProviderEndpoint::BindWithProviderHostInfo( |
+ content::ServiceWorkerProviderHostInfo* info) { |
+ mojom::ServiceWorkerProviderAssociatedPtr client_ptr; |
+ client_request_ = mojo::MakeIsolatedRequest(&client_ptr); |
+ info->client_ptr_info = client_ptr.PassInterface(); |
+ info->host_request = mojo::MakeIsolatedRequest(&host_ptr_); |
+} |
+ |
std::unique_ptr<ServiceWorkerProviderHost> CreateProviderHostForWindow( |
int process_id, |
int provider_id, |
bool is_parent_frame_secure, |
- base::WeakPtr<ServiceWorkerContextCore> context) { |
+ base::WeakPtr<ServiceWorkerContextCore> context, |
+ ServiceWorkerRemoteProviderEndpoint* output_endpoint) { |
ServiceWorkerProviderHostInfo info(provider_id, MSG_ROUTING_NONE, |
SERVICE_WORKER_PROVIDER_FOR_WINDOW, |
is_parent_frame_secure); |
+ output_endpoint->BindWithProviderHostInfo(&info); |
return ServiceWorkerProviderHost::Create(process_id, std::move(info), |
std::move(context), nullptr); |
} |
@@ -27,10 +45,12 @@ CreateProviderHostForServiceWorkerContext( |
int process_id, |
int provider_id, |
bool is_parent_frame_secure, |
- base::WeakPtr<ServiceWorkerContextCore> context) { |
+ base::WeakPtr<ServiceWorkerContextCore> context, |
+ ServiceWorkerRemoteProviderEndpoint* output_endpoint) { |
ServiceWorkerProviderHostInfo info(provider_id, MSG_ROUTING_NONE, |
SERVICE_WORKER_PROVIDER_FOR_CONTROLLER, |
is_parent_frame_secure); |
+ output_endpoint->BindWithProviderHostInfo(&info); |
return ServiceWorkerProviderHost::Create(process_id, std::move(info), |
std::move(context), nullptr); |
} |
@@ -40,9 +60,11 @@ std::unique_ptr<ServiceWorkerProviderHost> CreateProviderHostWithDispatcherHost( |
int provider_id, |
base::WeakPtr<ServiceWorkerContextCore> context, |
int route_id, |
- ServiceWorkerDispatcherHost* dispatcher_host) { |
+ ServiceWorkerDispatcherHost* dispatcher_host, |
+ ServiceWorkerRemoteProviderEndpoint* output_endpoint) { |
ServiceWorkerProviderHostInfo info(provider_id, route_id, |
SERVICE_WORKER_PROVIDER_FOR_WINDOW, true); |
+ output_endpoint->BindWithProviderHostInfo(&info); |
return ServiceWorkerProviderHost::Create(process_id, std::move(info), |
std::move(context), dispatcher_host); |
} |