| 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 531fd4b0f8249d02a442f2e10425892727c8232d..fce8783f92a32de78ef49bb677e70adc834b9bd4 100644
|
| --- a/content/child/service_worker/service_worker_dispatcher.cc
|
| +++ b/content/child/service_worker/service_worker_dispatcher.cc
|
| @@ -84,6 +84,8 @@
|
| OnSetControllerServiceWorker)
|
| IPC_MESSAGE_HANDLER(ServiceWorkerMsg_MessageToDocument,
|
| OnPostMessage)
|
| + IPC_MESSAGE_HANDLER(ServiceWorkerMsg_GetClientInfo,
|
| + OnGetClientInfo)
|
| IPC_MESSAGE_UNHANDLED(handled = false)
|
| IPC_END_MESSAGE_MAP()
|
| DCHECK(handled) << "Unhandled message:" << msg.type();
|
| @@ -661,6 +663,30 @@
|
| found->second->dispatchMessageEvent(message, ports);
|
| }
|
|
|
| +void ServiceWorkerDispatcher::OnGetClientInfo(int thread_id,
|
| + int embedded_worker_id,
|
| + int request_id,
|
| + int provider_id) {
|
| + blink::WebServiceWorkerClientInfo info;
|
| + ProviderClientMap::iterator found = provider_clients_.find(provider_id);
|
| + // TODO(ksakamoto): Could we track these values in the browser side? Except
|
| + // for |isFocused|, it would be pretty easy.
|
| + if (found != provider_clients_.end() && found->second->getClientInfo(&info)) {
|
| + ServiceWorkerClientInfo result;
|
| + result.client_id = info.clientID;
|
| + result.page_visibility_state = info.pageVisibilityState;
|
| + result.is_focused = info.isFocused;
|
| + result.url = info.url;
|
| + result.frame_type = static_cast<RequestContextFrameType>(info.frameType);
|
| +
|
| + thread_safe_sender_->Send(new ServiceWorkerHostMsg_GetClientInfoSuccess(
|
| + embedded_worker_id, request_id, result));
|
| + } else {
|
| + thread_safe_sender_->Send(new ServiceWorkerHostMsg_GetClientInfoError(
|
| + embedded_worker_id, request_id));
|
| + }
|
| +}
|
| +
|
| void ServiceWorkerDispatcher::AddServiceWorker(
|
| int handle_id, WebServiceWorkerImpl* worker) {
|
| DCHECK(!ContainsKey(service_workers_, handle_id));
|
|
|