| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/browser/service_worker/service_worker_dispatcher_host.h" | 5 #include "content/browser/service_worker/service_worker_dispatcher_host.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 860 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 871 const base::string16& message, | 871 const base::string16& message, |
| 872 const url::Origin& source_origin, | 872 const url::Origin& source_origin, |
| 873 const std::vector<TransferredMessagePort>& sent_message_ports, | 873 const std::vector<TransferredMessagePort>& sent_message_ports, |
| 874 const SourceInfo& source_info) { | 874 const SourceInfo& source_info) { |
| 875 if (!source_info.IsValid()) { | 875 if (!source_info.IsValid()) { |
| 876 DidFailToDispatchExtendableMessageEvent(sent_message_ports, | 876 DidFailToDispatchExtendableMessageEvent(sent_message_ports, |
| 877 SERVICE_WORKER_ERROR_FAILED); | 877 SERVICE_WORKER_ERROR_FAILED); |
| 878 return; | 878 return; |
| 879 } | 879 } |
| 880 worker->RunAfterStartWorker( | 880 worker->RunAfterStartWorker( |
| 881 ServiceWorkerMetrics::EventType::MESSAGE, |
| 881 base::Bind(&ServiceWorkerDispatcherHost:: | 882 base::Bind(&ServiceWorkerDispatcherHost:: |
| 882 DispatchExtendableMessageEventAfterStartWorker, | 883 DispatchExtendableMessageEventAfterStartWorker, |
| 883 this, worker, message, source_origin, sent_message_ports, | 884 this, worker, message, source_origin, sent_message_ports, |
| 884 ExtendableMessageEventSource(source_info)), | 885 ExtendableMessageEventSource(source_info)), |
| 885 base::Bind( | 886 base::Bind( |
| 886 &ServiceWorkerDispatcherHost::DidFailToDispatchExtendableMessageEvent, | 887 &ServiceWorkerDispatcherHost::DidFailToDispatchExtendableMessageEvent, |
| 887 this, sent_message_ports)); | 888 this, sent_message_ports)); |
| 888 } | 889 } |
| 889 | 890 |
| 890 void ServiceWorkerDispatcherHost:: | 891 void ServiceWorkerDispatcherHost:: |
| (...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1389 if (!handle) { | 1390 if (!handle) { |
| 1390 bad_message::ReceivedBadMessage(this, | 1391 bad_message::ReceivedBadMessage(this, |
| 1391 bad_message::SWDH_TERMINATE_BAD_HANDLE); | 1392 bad_message::SWDH_TERMINATE_BAD_HANDLE); |
| 1392 return; | 1393 return; |
| 1393 } | 1394 } |
| 1394 handle->version()->StopWorker( | 1395 handle->version()->StopWorker( |
| 1395 base::Bind(&ServiceWorkerUtils::NoOpStatusCallback)); | 1396 base::Bind(&ServiceWorkerUtils::NoOpStatusCallback)); |
| 1396 } | 1397 } |
| 1397 | 1398 |
| 1398 } // namespace content | 1399 } // namespace content |
| OLD | NEW |