Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(779)

Unified Diff: content/browser/navigator_connect/navigator_connect_dispatcher_host.cc

Issue 781723002: Pass navigator.connect calls through to the browser process. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..bd9036a42fdcb8ac56c63a69f165dcfd4f7173e2
--- /dev/null
+++ b/content/browser/navigator_connect/navigator_connect_dispatcher_host.cc
@@ -0,0 +1,41 @@
+// 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"
+#include "content/common/navigator_connect_types.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 CrossOriginServiceWorkerClient& client) {
+ // TODO(mek): Actually setup a connection.
+
+ // Close port since connection fails.
+ MessagePortService::GetInstance()->ClosePort(client.message_port_id);
+ Send(new NavigatorConnectMsg_ConnectResult(thread_id, request_id, false));
+}
+
+} // namespace content

Powered by Google App Engine
This is Rietveld 408576698