| Index: content/child/service_worker/service_worker_dispatcher.cc
|
| diff --git a/content/child/service_worker/service_worker_dispatcher.cc b/content/child/service_worker/service_worker_dispatcher.cc
|
| index be61ffb7a3a0abe7b44e50dfc59d05269111372e..9d7c9d0743a1edfc896d48a68cdd7d5033a9a9e4 100644
|
| --- a/content/child/service_worker/service_worker_dispatcher.cc
|
| +++ b/content/child/service_worker/service_worker_dispatcher.cc
|
| @@ -421,7 +421,8 @@ void ServiceWorkerDispatcher::OnRegistered(
|
| int thread_id,
|
| int request_id,
|
| const ServiceWorkerRegistrationObjectInfo& info,
|
| - const ServiceWorkerVersionAttributes& attrs) {
|
| + const ServiceWorkerVersionAttributes& attrs,
|
| + const mojo::MessagePipeHandle& url_loader_factory) {
|
| TRACE_EVENT_ASYNC_STEP_INTO0("ServiceWorker",
|
| "ServiceWorkerDispatcher::RegisterServiceWorker",
|
| request_id,
|
| @@ -435,6 +436,12 @@ void ServiceWorkerDispatcher::OnRegistered(
|
| if (!callbacks)
|
| return;
|
|
|
| + if (url_loader_factory.is_valid()) {
|
| + // Chrome doesn't use interface versioning.
|
| + url_loader_factory_.Bind(mojom::URLLoaderFactoryPtrInfo(
|
| + mojo::ScopedMessagePipeHandle(url_loader_factory), 0u));
|
| + }
|
| +
|
| callbacks->OnSuccess(WebServiceWorkerRegistrationImpl::CreateHandle(
|
| GetOrAdoptRegistration(info, attrs)));
|
| pending_registration_callbacks_.Remove(request_id);
|
| @@ -481,7 +488,8 @@ void ServiceWorkerDispatcher::OnDidGetRegistration(
|
| int thread_id,
|
| int request_id,
|
| const ServiceWorkerRegistrationObjectInfo& info,
|
| - const ServiceWorkerVersionAttributes& attrs) {
|
| + const ServiceWorkerVersionAttributes& attrs,
|
| + const mojo::MessagePipeHandle& url_loader_factory) {
|
| TRACE_EVENT_ASYNC_STEP_INTO0(
|
| "ServiceWorker",
|
| "ServiceWorkerDispatcher::GetRegistration",
|
| @@ -500,6 +508,8 @@ void ServiceWorkerDispatcher::OnDidGetRegistration(
|
| if (info.handle_id != kInvalidServiceWorkerRegistrationHandleId)
|
| registration = GetOrAdoptRegistration(info, attrs);
|
|
|
| + // TODO(scottmg) factory
|
| +
|
| callbacks->OnSuccess(
|
| WebServiceWorkerRegistrationImpl::CreateHandle(registration));
|
| pending_get_registration_callbacks_.Remove(request_id);
|
| @@ -509,7 +519,8 @@ void ServiceWorkerDispatcher::OnDidGetRegistrations(
|
| int thread_id,
|
| int request_id,
|
| const std::vector<ServiceWorkerRegistrationObjectInfo>& infos,
|
| - const std::vector<ServiceWorkerVersionAttributes>& attrs) {
|
| + const std::vector<ServiceWorkerVersionAttributes>& attrs,
|
| + const std::vector<mojo::MessagePipeHandle>& url_loader_factories) {
|
| TRACE_EVENT_ASYNC_STEP_INTO0(
|
| "ServiceWorker",
|
| "ServiceWorkerDispatcher::GetRegistrations",
|
| @@ -525,6 +536,8 @@ void ServiceWorkerDispatcher::OnDidGetRegistrations(
|
| if (!callbacks)
|
| return;
|
|
|
| + // TODO(scottmg) factory
|
| +
|
| using WebServiceWorkerRegistrationHandles =
|
| WebServiceWorkerProvider::WebServiceWorkerRegistrationHandles;
|
| std::unique_ptr<WebServiceWorkerRegistrationHandles> registrations =
|
| @@ -544,7 +557,8 @@ void ServiceWorkerDispatcher::OnDidGetRegistrationForReady(
|
| int thread_id,
|
| int request_id,
|
| const ServiceWorkerRegistrationObjectInfo& info,
|
| - const ServiceWorkerVersionAttributes& attrs) {
|
| + const ServiceWorkerVersionAttributes& attrs,
|
| + const mojo::MessagePipeHandle& url_loader_factory) {
|
| TRACE_EVENT_ASYNC_STEP_INTO0(
|
| "ServiceWorker",
|
| "ServiceWorkerDispatcher::GetRegistrationForReady",
|
| @@ -559,6 +573,8 @@ void ServiceWorkerDispatcher::OnDidGetRegistrationForReady(
|
| if (!callbacks)
|
| return;
|
|
|
| + // TODO(scottmg): factory
|
| +
|
| callbacks->OnSuccess(WebServiceWorkerRegistrationImpl::CreateHandle(
|
| GetOrAdoptRegistration(info, attrs)));
|
| get_for_ready_callbacks_.Remove(request_id);
|
|
|