Chromium Code Reviews| Index: content/child/service_worker/web_service_worker_provider_impl.cc |
| diff --git a/content/child/service_worker/web_service_worker_provider_impl.cc b/content/child/service_worker/web_service_worker_provider_impl.cc |
| index 851fad940c40bb33d054787505206cf363bc66f7..11b44b5cf089a8230334226db651dd6c386abeb4 100644 |
| --- a/content/child/service_worker/web_service_worker_provider_impl.cc |
| +++ b/content/child/service_worker/web_service_worker_provider_impl.cc |
| @@ -49,20 +49,20 @@ void WebServiceWorkerProviderImpl::setClient( |
| // for more context) |
| GetDispatcher()->AddProviderClient(provider_id_, client); |
| - if (!context_->registration()) { |
| - // This provider is not associated with any registration. |
| + if (!context_->IsAssociatedWithRegistration()) |
|
Kunihiko Sakamoto
2015/01/28 06:38:55
I wonder if this and GetRegistrationInfoAndVersion
nhiroki
2015/01/28 07:42:27
Good point. Done.
|
| return; |
| - } |
| // Set .ready if the associated registration has the active service worker. |
| if (context_->active_handle_id() != kInvalidServiceWorkerHandleId) { |
| + ServiceWorkerRegistrationObjectInfo info; |
| + ServiceWorkerVersionAttributes attrs; |
| + context_->GetRegistrationInfoAndVersionAttributes(&info, &attrs); |
| + |
| WebServiceWorkerRegistrationImpl* registration = |
| - GetDispatcher()->FindServiceWorkerRegistration( |
| - context_->registration()->info(), false); |
| + GetDispatcher()->FindServiceWorkerRegistration(info, false); |
| if (!registration) { |
| - registration = GetDispatcher()->CreateServiceWorkerRegistration( |
| - context_->registration()->info(), false); |
| - ServiceWorkerVersionAttributes attrs = context_->GetVersionAttributes(); |
| + registration = |
| + GetDispatcher()->CreateServiceWorkerRegistration(info, false); |
| registration->SetInstalling( |
| GetDispatcher()->GetServiceWorker(attrs.installing, false)); |
| registration->SetWaiting( |