Chromium Code Reviews| 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 0a30cfbb25c612454d851c7cfcfe20f34762a9f7..12bff6fbcda46cdeaed3f14b3051e2a08efd1234 100644 |
| --- a/content/child/service_worker/service_worker_dispatcher.cc |
| +++ b/content/child/service_worker/service_worker_dispatcher.cc |
| @@ -57,6 +57,8 @@ ServiceWorkerDispatcher::~ServiceWorkerDispatcher() { |
| void ServiceWorkerDispatcher::OnMessageReceived(const IPC::Message& msg) { |
| bool handled = true; |
| IPC_BEGIN_MESSAGE_MAP(ServiceWorkerDispatcher, msg) |
| + IPC_MESSAGE_HANDLER(ServiceWorkerMsg_AssociateRegistrationWithServiceWorker, |
| + OnAssociateRegistrationWithServiceWorker) |
| IPC_MESSAGE_HANDLER(ServiceWorkerMsg_AssociateRegistration, |
| OnAssociateRegistration) |
| IPC_MESSAGE_HANDLER(ServiceWorkerMsg_DisassociateRegistration, |
| @@ -300,6 +302,22 @@ ServiceWorkerDispatcher::CreateServiceWorkerRegistration( |
| return new WebServiceWorkerRegistrationImpl(handle_ref.Pass()); |
| } |
| +void ServiceWorkerDispatcher::OnAssociateRegistrationWithServiceWorker( |
|
kinuko
2015/01/22 08:14:00
I think there's a strong assumption that this shou
nhiroki
2015/01/22 09:09:16
That's right.
Ideally, these info and attrs are p
|
| + int thread_id, |
| + int provider_id, |
| + const ServiceWorkerRegistrationObjectInfo& info, |
| + const ServiceWorkerVersionAttributes& attrs) { |
| + DCHECK_EQ(kDocumentMainThreadId, thread_id); |
| + |
| + ProviderContextMap::iterator context = provider_contexts_.find(provider_id); |
| + if (context == provider_contexts_.end()) |
| + return; |
| + context->second->OnAssociateRegistration(info, attrs); |
| + |
| + // We don't have to add entries into |worker_to_provider_| because state |
| + // change events for the workers will be notified on the worker thread. |
| +} |
| + |
| void ServiceWorkerDispatcher::OnAssociateRegistration( |
| int thread_id, |
| int provider_id, |