| Index: content/browser/service_worker/service_worker_dispatcher_host.cc
 | 
| diff --git a/content/browser/service_worker/service_worker_dispatcher_host.cc b/content/browser/service_worker/service_worker_dispatcher_host.cc
 | 
| index 872ac5735eab12be49c281e6448c2905f9df5e47..317107ab6095c9e333cc1859fd235933167e5663 100644
 | 
| --- a/content/browser/service_worker/service_worker_dispatcher_host.cc
 | 
| +++ b/content/browser/service_worker/service_worker_dispatcher_host.cc
 | 
| @@ -163,6 +163,8 @@ bool ServiceWorkerDispatcherHost::OnMessageReceived(
 | 
|                          OnUnregisterServiceWorker)
 | 
|      IPC_MESSAGE_HANDLER(ServiceWorkerHostMsg_GetRegistration,
 | 
|                          OnGetRegistration)
 | 
| +    IPC_MESSAGE_HANDLER(ServiceWorkerHostMsg_GetRegistrationForReady,
 | 
| +                        OnGetRegistrationForReady)
 | 
|      IPC_MESSAGE_HANDLER(ServiceWorkerHostMsg_ProviderCreated,
 | 
|                          OnProviderCreated)
 | 
|      IPC_MESSAGE_HANDLER(ServiceWorkerHostMsg_ProviderDestroyed,
 | 
| @@ -492,6 +494,35 @@ void ServiceWorkerDispatcherHost::OnGetRegistration(
 | 
|                   request_id));
 | 
|  }
 | 
|  
 | 
| +void ServiceWorkerDispatcherHost::OnGetRegistrationForReady(
 | 
| +    int thread_id,
 | 
| +    int request_id,
 | 
| +    int provider_id) {
 | 
| +  TRACE_EVENT0("ServiceWorker",
 | 
| +               "ServiceWorkerDispatcherHost::OnGetRegistrationForReady");
 | 
| +  if (!GetContext())
 | 
| +    return;
 | 
| +  ServiceWorkerProviderHost* provider_host =
 | 
| +      GetContext()->GetProviderHost(render_process_id_, provider_id);
 | 
| +  if (!provider_host) {
 | 
| +    BadMessageReceived();
 | 
| +    return;
 | 
| +  }
 | 
| +  if (!provider_host->IsContextAlive())
 | 
| +    return;
 | 
| +
 | 
| +  TRACE_EVENT_ASYNC_BEGIN0(
 | 
| +      "ServiceWorker",
 | 
| +      "ServiceWorkerDispatcherHost::GetRegistrationForReady",
 | 
| +      request_id);
 | 
| +
 | 
| +  if (!provider_host->GetRegistrationForReady(base::Bind(
 | 
| +          &ServiceWorkerDispatcherHost::GetRegistrationForReadyComplete,
 | 
| +          this, thread_id, request_id, provider_host->AsWeakPtr()))) {
 | 
| +    BadMessageReceived();
 | 
| +  }
 | 
| +}
 | 
| +
 | 
|  void ServiceWorkerDispatcherHost::OnPostMessageToWorker(
 | 
|      int handle_id,
 | 
|      const base::string16& message,
 | 
| @@ -908,6 +939,30 @@ void ServiceWorkerDispatcherHost::GetRegistrationComplete(
 | 
|        thread_id, request_id, info, attrs));
 | 
|  }
 | 
|  
 | 
| +void ServiceWorkerDispatcherHost::GetRegistrationForReadyComplete(
 | 
| +    int thread_id,
 | 
| +    int request_id,
 | 
| +    base::WeakPtr<ServiceWorkerProviderHost> provider_host,
 | 
| +    ServiceWorkerRegistration* registration) {
 | 
| +  DCHECK(registration);
 | 
| +  TRACE_EVENT_ASYNC_END1("ServiceWorker",
 | 
| +                         "ServiceWorkerDispatcherHost::GetRegistrationForReady",
 | 
| +                         request_id,
 | 
| +                         "Registration ID",
 | 
| +                         registration ? registration->id()
 | 
| +                             : kInvalidServiceWorkerRegistrationId);
 | 
| +
 | 
| +  if (!GetContext())
 | 
| +    return;
 | 
| +
 | 
| +  ServiceWorkerRegistrationObjectInfo info;
 | 
| +  ServiceWorkerVersionAttributes attrs;
 | 
| +  GetRegistrationObjectInfoAndVersionAttributes(
 | 
| +      provider_host, registration, &info, &attrs);
 | 
| +  Send(new ServiceWorkerMsg_DidGetRegistrationForReady(
 | 
| +        thread_id, request_id, info, attrs));
 | 
| +}
 | 
| +
 | 
|  void ServiceWorkerDispatcherHost::SendRegistrationError(
 | 
|      int thread_id,
 | 
|      int request_id,
 | 
| 
 |