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

Unified Diff: content/child/service_worker/service_worker_dispatcher.cc

Issue 445883003: ServiceWorker: Consolidate version change messages (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 4 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
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);
« no previous file with comments | « content/child/service_worker/service_worker_dispatcher.h ('k') | content/child/service_worker/service_worker_message_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698