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 3b9bf4997e57b2f21f7c5b22cb44b6f487090755..14dfde6b664263f297260fa7fa3c060c686ba783 100644 |
--- a/content/child/service_worker/service_worker_dispatcher.cc |
+++ b/content/child/service_worker/service_worker_dispatcher.cc |
@@ -59,12 +59,8 @@ void ServiceWorkerDispatcher::OnMessageReceived(const IPC::Message& msg) { |
OnRegistrationError) |
IPC_MESSAGE_HANDLER(ServiceWorkerMsg_ServiceWorkerStateChanged, |
OnServiceWorkerStateChanged) |
- IPC_MESSAGE_HANDLER(ServiceWorkerMsg_SetInstallingServiceWorker, |
- OnSetInstallingServiceWorker) |
- IPC_MESSAGE_HANDLER(ServiceWorkerMsg_SetWaitingServiceWorker, |
- OnSetWaitingServiceWorker) |
- IPC_MESSAGE_HANDLER(ServiceWorkerMsg_SetActiveServiceWorker, |
- OnSetActiveServiceWorker) |
+ IPC_MESSAGE_HANDLER(ServiceWorkerMsg_SetVersionAttributes, |
+ OnSetVersionAttributes) |
IPC_MESSAGE_HANDLER(ServiceWorkerMsg_SetControllerServiceWorker, |
OnSetControllerServiceWorker) |
IPC_MESSAGE_HANDLER(ServiceWorkerMsg_MessageToDocument, |
@@ -267,9 +263,22 @@ void ServiceWorkerDispatcher::OnServiceWorkerStateChanged( |
provider->second->OnServiceWorkerStateChanged(handle_id, state); |
} |
-void ServiceWorkerDispatcher::OnSetInstallingServiceWorker( |
+void ServiceWorkerDispatcher::OnSetVersionAttributes( |
int thread_id, |
int provider_id, |
+ int changed_mask, |
+ const ServiceWorkerVersionAttributes& attributes) { |
+ ChangedVersionAttributesMask mask(changed_mask); |
+ if (mask.installing_changed()) |
+ SetInstallingServiceWorker(provider_id, attributes.installing); |
+ if (mask.waiting_changed()) |
+ SetWaitingServiceWorker(provider_id, attributes.waiting); |
+ if (mask.active_changed()) |
+ SetActiveServiceWorker(provider_id, attributes.active); |
+} |
+ |
+void ServiceWorkerDispatcher::SetInstallingServiceWorker( |
+ int provider_id, |
const ServiceWorkerObjectInfo& info) { |
ProviderContextMap::iterator provider = provider_contexts_.find(provider_id); |
if (provider != provider_contexts_.end()) { |
@@ -294,8 +303,7 @@ void ServiceWorkerDispatcher::OnSetInstallingServiceWorker( |
} |
} |
-void ServiceWorkerDispatcher::OnSetWaitingServiceWorker( |
- int thread_id, |
+void ServiceWorkerDispatcher::SetWaitingServiceWorker( |
int provider_id, |
const ServiceWorkerObjectInfo& info) { |
ProviderContextMap::iterator provider = provider_contexts_.find(provider_id); |
@@ -321,8 +329,7 @@ void ServiceWorkerDispatcher::OnSetWaitingServiceWorker( |
} |
} |
-void ServiceWorkerDispatcher::OnSetActiveServiceWorker( |
- int thread_id, |
+void ServiceWorkerDispatcher::SetActiveServiceWorker( |
int provider_id, |
const ServiceWorkerObjectInfo& info) { |
ProviderContextMap::iterator provider = provider_contexts_.find(provider_id); |