| Index: content/renderer/service_worker/service_worker_script_context.cc
|
| diff --git a/content/renderer/service_worker/service_worker_script_context.cc b/content/renderer/service_worker/service_worker_script_context.cc
|
| index 33f4dd0d124ef0dde6061fad678da37d85bf24e5..62e091adf1ae4099546a4c32d38bfb85e13a2877 100644
|
| --- a/content/renderer/service_worker/service_worker_script_context.cc
|
| +++ b/content/renderer/service_worker/service_worker_script_context.cc
|
| @@ -81,6 +81,7 @@ void ServiceWorkerScriptContext::OnMessageReceived(
|
| IPC_MESSAGE_HANDLER(ServiceWorkerMsg_MessageToWorker, OnPostMessage)
|
| IPC_MESSAGE_HANDLER(ServiceWorkerMsg_DidGetClientDocuments,
|
| OnDidGetClientDocuments)
|
| + IPC_MESSAGE_HANDLER(ServiceWorkerMsg_DidSkipWaiting, OnDidSkipWaiting)
|
| IPC_MESSAGE_UNHANDLED(handled = false)
|
| IPC_END_MESSAGE_MAP()
|
|
|
| @@ -172,6 +173,13 @@ void ServiceWorkerScriptContext::PostMessageToDocument(
|
| GetRoutingID(), client_id, message, base::Passed(&channels)));
|
| }
|
|
|
| +void ServiceWorkerScriptContext::SkipWaiting(
|
| + blink::WebServiceWorkerSkipWaitingCallbacks* callbacks) {
|
| + DCHECK(callbacks);
|
| + int request_id = pending_skip_waiting_callbacks_.Add(callbacks);
|
| + Send(new ServiceWorkerHostMsg_SkipWaiting(GetRoutingID(), request_id));
|
| +}
|
| +
|
| void ServiceWorkerScriptContext::Send(IPC::Message* message) {
|
| embedded_context_->Send(message);
|
| }
|
| @@ -295,4 +303,15 @@ void ServiceWorkerScriptContext::OnDidGetClientDocuments(
|
| pending_clients_callbacks_.Remove(request_id);
|
| }
|
|
|
| +void ServiceWorkerScriptContext::OnDidSkipWaiting(int request_id) {
|
| + blink::WebServiceWorkerSkipWaitingCallbacks* callbacks =
|
| + pending_skip_waiting_callbacks_.Lookup(request_id);
|
| + if (!callbacks) {
|
| + NOTREACHED() << "Got stray response: " << request_id;
|
| + return;
|
| + }
|
| + callbacks->onSuccess();
|
| + pending_skip_waiting_callbacks_.Remove(request_id);
|
| +}
|
| +
|
| } // namespace content
|
|
|