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/child/service_worker/service_worker_dispatcher.h" | 5 #include "content/child/service_worker/service_worker_dispatcher.h" |
6 | 6 |
7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
10 #include "base/threading/thread_local.h" | 10 #include "base/threading/thread_local.h" |
11 #include "content/child/child_thread.h" | 11 #include "content/child/child_thread.h" |
| 12 #include "content/child/service_worker/navigator_connect_provider.h" |
12 #include "content/child/service_worker/service_worker_handle_reference.h" | 13 #include "content/child/service_worker/service_worker_handle_reference.h" |
13 #include "content/child/service_worker/service_worker_provider_context.h" | 14 #include "content/child/service_worker/service_worker_provider_context.h" |
14 #include "content/child/service_worker/service_worker_registration_handle_refere
nce.h" | 15 #include "content/child/service_worker/service_worker_registration_handle_refere
nce.h" |
15 #include "content/child/service_worker/web_service_worker_impl.h" | 16 #include "content/child/service_worker/web_service_worker_impl.h" |
16 #include "content/child/service_worker/web_service_worker_registration_impl.h" | 17 #include "content/child/service_worker/web_service_worker_registration_impl.h" |
17 #include "content/child/thread_safe_sender.h" | 18 #include "content/child/thread_safe_sender.h" |
18 #include "content/child/webmessageportchannel_impl.h" | 19 #include "content/child/webmessageportchannel_impl.h" |
19 #include "content/common/service_worker/service_worker_messages.h" | 20 #include "content/common/service_worker/service_worker_messages.h" |
20 #include "content/public/common/url_utils.h" | 21 #include "content/public/common/url_utils.h" |
21 #include "third_party/WebKit/public/platform/WebServiceWorkerProviderClient.h" | 22 #include "third_party/WebKit/public/platform/WebServiceWorkerProviderClient.h" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 IPC_MESSAGE_HANDLER(ServiceWorkerMsg_ServiceWorkerStateChanged, | 73 IPC_MESSAGE_HANDLER(ServiceWorkerMsg_ServiceWorkerStateChanged, |
73 OnServiceWorkerStateChanged) | 74 OnServiceWorkerStateChanged) |
74 IPC_MESSAGE_HANDLER(ServiceWorkerMsg_SetVersionAttributes, | 75 IPC_MESSAGE_HANDLER(ServiceWorkerMsg_SetVersionAttributes, |
75 OnSetVersionAttributes) | 76 OnSetVersionAttributes) |
76 IPC_MESSAGE_HANDLER(ServiceWorkerMsg_UpdateFound, | 77 IPC_MESSAGE_HANDLER(ServiceWorkerMsg_UpdateFound, |
77 OnUpdateFound) | 78 OnUpdateFound) |
78 IPC_MESSAGE_HANDLER(ServiceWorkerMsg_SetControllerServiceWorker, | 79 IPC_MESSAGE_HANDLER(ServiceWorkerMsg_SetControllerServiceWorker, |
79 OnSetControllerServiceWorker) | 80 OnSetControllerServiceWorker) |
80 IPC_MESSAGE_HANDLER(ServiceWorkerMsg_MessageToDocument, | 81 IPC_MESSAGE_HANDLER(ServiceWorkerMsg_MessageToDocument, |
81 OnPostMessage) | 82 OnPostMessage) |
| 83 IPC_MESSAGE_FORWARD(ServiceWorkerMsg_NavigatorConnectResult, |
| 84 NavigatorConnectProvider::ThreadSpecificInstance( |
| 85 thread_safe_sender_.get()), |
| 86 NavigatorConnectProvider::OnNavigatorConnectResult) |
82 IPC_MESSAGE_UNHANDLED(handled = false) | 87 IPC_MESSAGE_UNHANDLED(handled = false) |
83 IPC_END_MESSAGE_MAP() | 88 IPC_END_MESSAGE_MAP() |
84 DCHECK(handled) << "Unhandled message:" << msg.type(); | 89 DCHECK(handled) << "Unhandled message:" << msg.type(); |
85 } | 90 } |
86 | 91 |
87 bool ServiceWorkerDispatcher::Send(IPC::Message* msg) { | 92 bool ServiceWorkerDispatcher::Send(IPC::Message* msg) { |
88 return thread_safe_sender_->Send(msg); | 93 return thread_safe_sender_->Send(msg); |
89 } | 94 } |
90 | 95 |
91 void ServiceWorkerDispatcher::RegisterServiceWorker( | 96 void ServiceWorkerDispatcher::RegisterServiceWorker( |
(...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
730 attrs.installing, thread_safe_sender_.get()); | 735 attrs.installing, thread_safe_sender_.get()); |
731 ServiceWorkerHandleReference::Adopt( | 736 ServiceWorkerHandleReference::Adopt( |
732 attrs.waiting, thread_safe_sender_.get()); | 737 attrs.waiting, thread_safe_sender_.get()); |
733 ServiceWorkerHandleReference::Adopt( | 738 ServiceWorkerHandleReference::Adopt( |
734 attrs.active, thread_safe_sender_.get()); | 739 attrs.active, thread_safe_sender_.get()); |
735 } | 740 } |
736 return registration; | 741 return registration; |
737 } | 742 } |
738 | 743 |
739 } // namespace content | 744 } // namespace content |
OLD | NEW |