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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "content/browser/navigator_connect/navigator_connect_dispatcher_host.h"
6
7 #include "content/browser/message_port_service.h"
8 #include "content/common/navigator_connect_messages.h"
9 #include "content/common/navigator_connect_types.h"
10
11 namespace content {
12
13 NavigatorConnectDispatcherHost::NavigatorConnectDispatcherHost()
14 : BrowserMessageFilter(NavigatorConnectMsgStart) {
15 }
16
17 NavigatorConnectDispatcherHost::~NavigatorConnectDispatcherHost() {
18 }
19
20 bool NavigatorConnectDispatcherHost::OnMessageReceived(
21 const IPC::Message& message) {
22 bool handled = true;
23 IPC_BEGIN_MESSAGE_MAP(NavigatorConnectDispatcherHost, message)
24 IPC_MESSAGE_HANDLER(NavigatorConnectHostMsg_Connect, OnConnect)
25 IPC_MESSAGE_UNHANDLED(handled = false)
26 IPC_END_MESSAGE_MAP()
27 return handled;
28 }
29
30 void NavigatorConnectDispatcherHost::OnConnect(
31 int thread_id,
32 int request_id,
33 const CrossOriginServiceWorkerClient& client) {
34 // TODO(mek): Actually setup a connection.
35
36 // Close port since connection fails.
37 MessagePortService::GetInstance()->ClosePort(client.message_port_id);
38 Send(new NavigatorConnectMsg_ConnectResult(thread_id, request_id, false));
39 }
40
41 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698