| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/renderer/service_worker/service_worker_script_context.h" | 5 #include "content/renderer/service_worker/service_worker_script_context.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
| 9 #include "base/trace_event/trace_event.h" | 9 #include "base/trace_event/trace_event.h" |
| 10 #include "content/child/notifications/notification_data_conversions.h" | 10 #include "content/child/notifications/notification_data_conversions.h" |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 OnDidGetClientDocuments) | 120 OnDidGetClientDocuments) |
| 121 IPC_MESSAGE_HANDLER(ServiceWorkerMsg_OpenWindowResponse, | 121 IPC_MESSAGE_HANDLER(ServiceWorkerMsg_OpenWindowResponse, |
| 122 OnOpenWindowResponse) | 122 OnOpenWindowResponse) |
| 123 IPC_MESSAGE_HANDLER(ServiceWorkerMsg_OpenWindowError, | 123 IPC_MESSAGE_HANDLER(ServiceWorkerMsg_OpenWindowError, |
| 124 OnOpenWindowError) | 124 OnOpenWindowError) |
| 125 IPC_MESSAGE_HANDLER(ServiceWorkerMsg_FocusClientResponse, | 125 IPC_MESSAGE_HANDLER(ServiceWorkerMsg_FocusClientResponse, |
| 126 OnFocusClientResponse) | 126 OnFocusClientResponse) |
| 127 IPC_MESSAGE_HANDLER(ServiceWorkerMsg_DidSkipWaiting, OnDidSkipWaiting) | 127 IPC_MESSAGE_HANDLER(ServiceWorkerMsg_DidSkipWaiting, OnDidSkipWaiting) |
| 128 IPC_MESSAGE_HANDLER(ServiceWorkerMsg_DidClaimClients, OnDidClaimClients) | 128 IPC_MESSAGE_HANDLER(ServiceWorkerMsg_DidClaimClients, OnDidClaimClients) |
| 129 IPC_MESSAGE_HANDLER(ServiceWorkerMsg_ClaimClientsError, OnClaimClientsError) | 129 IPC_MESSAGE_HANDLER(ServiceWorkerMsg_ClaimClientsError, OnClaimClientsError) |
| 130 IPC_MESSAGE_HANDLER(ServiceWorkerMsg_Ping, OnPing); |
| 130 IPC_MESSAGE_UNHANDLED(handled = false) | 131 IPC_MESSAGE_UNHANDLED(handled = false) |
| 131 IPC_END_MESSAGE_MAP() | 132 IPC_END_MESSAGE_MAP() |
| 132 | 133 |
| 133 // TODO(gavinp): Would it be preferable to put an AddListener() method to | 134 // TODO(gavinp): Would it be preferable to put an AddListener() method to |
| 134 // EmbeddedWorkerContextClient? | 135 // EmbeddedWorkerContextClient? |
| 135 if (!handled) | 136 if (!handled) |
| 136 handled = cache_storage_dispatcher_->OnMessageReceived(message); | 137 handled = cache_storage_dispatcher_->OnMessageReceived(message); |
| 137 | 138 |
| 138 DCHECK(handled); | 139 DCHECK(handled); |
| 139 } | 140 } |
| (...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 564 if (!callbacks) { | 565 if (!callbacks) { |
| 565 NOTREACHED() << "Got stray response: " << request_id; | 566 NOTREACHED() << "Got stray response: " << request_id; |
| 566 return; | 567 return; |
| 567 } | 568 } |
| 568 scoped_ptr<blink::WebServiceWorkerError> error( | 569 scoped_ptr<blink::WebServiceWorkerError> error( |
| 569 new blink::WebServiceWorkerError(error_type, message)); | 570 new blink::WebServiceWorkerError(error_type, message)); |
| 570 callbacks->onError(error.release()); | 571 callbacks->onError(error.release()); |
| 571 pending_claim_clients_callbacks_.Remove(request_id); | 572 pending_claim_clients_callbacks_.Remove(request_id); |
| 572 } | 573 } |
| 573 | 574 |
| 575 void ServiceWorkerScriptContext::OnPing() { |
| 576 Send(new ServiceWorkerHostMsg_Pong(GetRoutingID())); |
| 577 } |
| 578 |
| 574 } // namespace content | 579 } // namespace content |
| OLD | NEW |