Index: content/child/service_worker/web_service_worker_impl.cc |
diff --git a/content/child/service_worker/web_service_worker_impl.cc b/content/child/service_worker/web_service_worker_impl.cc |
index 02d9cf8ca772096907baeb01c944c7a11d9f3a3e..a63d65c92591f226118fa725845b5397b9a23e50 100644 |
--- a/content/child/service_worker/web_service_worker_impl.cc |
+++ b/content/child/service_worker/web_service_worker_impl.cc |
@@ -4,8 +4,34 @@ |
#include "content/child/service_worker/web_service_worker_impl.h" |
+#include "content/child/thread_safe_sender.h" |
+#include "content/child/webmessageportchannel_impl.h" |
+#include "content/common/service_worker/service_worker_messages.h" |
+#include "ipc/ipc_message.h" |
+#include "third_party/WebKit/public/platform/WebString.h" |
+ |
+using blink::WebMessagePortChannel; |
+using blink::WebMessagePortChannelArray; |
+using blink::WebMessagePortChannelClient; |
+using blink::WebString; |
+ |
namespace content { |
WebServiceWorkerImpl::~WebServiceWorkerImpl() {} |
+void WebServiceWorkerImpl::postMessage( |
+ const WebString& message, |
+ WebMessagePortChannelArray* channels) { |
+ PostMessage(message, channels); |
marja
2014/03/17 09:15:02
Why this indirection?
jsbell
2014/03/17 16:49:06
No need now. Squashed the methods.
(Before I fact
|
+} |
+ |
+void WebServiceWorkerImpl::PostMessage( |
+ const base::string16& message, |
+ WebMessagePortChannelArray* channels) { |
+ std::vector<int> message_port_ids; |
+ WebMessagePortChannelImpl::ExtractMessagePortIDs(channels, &message_port_ids); |
+ thread_safe_sender_->Send(new ServiceWorkerHostMsg_PostMessage( |
+ registration_id_, message, message_port_ids)); |
+} |
+ |
} // namespace content |