Index: content/browser/navigator_connect/navigator_connect_dispatcher_host.cc |
diff --git a/content/browser/navigator_connect/navigator_connect_dispatcher_host.cc b/content/browser/navigator_connect/navigator_connect_dispatcher_host.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..81e9b8141df7d4cf75331b7273d534798254dbc0 |
--- /dev/null |
+++ b/content/browser/navigator_connect/navigator_connect_dispatcher_host.cc |
@@ -0,0 +1,40 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "content/browser/navigator_connect/navigator_connect_dispatcher_host.h" |
+ |
+#include "content/browser/message_port_service.h" |
+#include "content/common/navigator_connect_messages.h" |
+ |
+namespace content { |
+ |
+NavigatorConnectDispatcherHost::NavigatorConnectDispatcherHost() |
+ : BrowserMessageFilter(NavigatorConnectMsgStart) { |
+} |
+ |
+NavigatorConnectDispatcherHost::~NavigatorConnectDispatcherHost() { |
+} |
+ |
+bool NavigatorConnectDispatcherHost::OnMessageReceived( |
+ const IPC::Message& message) { |
+ bool handled = true; |
+ IPC_BEGIN_MESSAGE_MAP(NavigatorConnectDispatcherHost, message) |
+ IPC_MESSAGE_HANDLER(NavigatorConnectHostMsg_Connect, OnConnect) |
+ IPC_MESSAGE_UNHANDLED(handled = false) |
+ IPC_END_MESSAGE_MAP() |
+ return handled; |
+} |
+ |
+void NavigatorConnectDispatcherHost::OnConnect(int thread_id, |
+ int request_id, |
+ const GURL& target_url, |
+ int message_port_id) { |
+ // TODO(mek): Actually setup a connection. |
palmer
2014/12/10 01:40:44
Should there be any check that the |target_url| ha
Marijn Kruisselbrink
2014/12/10 17:14:26
It is completely up to the (service worker control
|
+ |
+ // Close port since connection fails. |
+ MessagePortService::GetInstance()->ClosePort(message_port_id); |
+ Send(new NavigatorConnectMsg_ConnectResult(thread_id, request_id, false)); |
+} |
+ |
+} // namespace content |