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/web_service_worker_impl.h" | 5 #include "content/child/service_worker/web_service_worker_impl.h" |
6 | 6 |
| 7 #include "content/child/thread_safe_sender.h" |
| 8 #include "content/child/webmessageportchannel_impl.h" |
| 9 #include "content/common/service_worker/service_worker_messages.h" |
| 10 #include "third_party/WebKit/public/platform/WebString.h" |
| 11 |
| 12 using blink::WebMessagePortChannel; |
| 13 using blink::WebMessagePortChannelArray; |
| 14 using blink::WebMessagePortChannelClient; |
| 15 using blink::WebString; |
| 16 |
7 namespace content { | 17 namespace content { |
8 | 18 |
9 WebServiceWorkerImpl::~WebServiceWorkerImpl() {} | 19 WebServiceWorkerImpl::~WebServiceWorkerImpl() {} |
10 | 20 |
| 21 void WebServiceWorkerImpl::postMessage(const WebString& message, |
| 22 WebMessagePortChannelArray* channels) { |
| 23 thread_safe_sender_->Send(new ServiceWorkerHostMsg_PostMessage( |
| 24 registration_id_, |
| 25 message, |
| 26 WebMessagePortChannelImpl::ExtractMessagePortIDs(channels))); |
| 27 } |
| 28 |
11 } // namespace content | 29 } // namespace content |
OLD | NEW |