OLD | NEW |
---|---|
(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 | |
10 namespace content { | |
11 | |
12 NavigatorConnectDispatcherHost::NavigatorConnectDispatcherHost() | |
13 : BrowserMessageFilter(NavigatorConnectMsgStart) { | |
14 } | |
15 | |
16 NavigatorConnectDispatcherHost::~NavigatorConnectDispatcherHost() { | |
17 } | |
18 | |
19 bool NavigatorConnectDispatcherHost::OnMessageReceived( | |
20 const IPC::Message& message) { | |
21 bool handled = true; | |
22 IPC_BEGIN_MESSAGE_MAP(NavigatorConnectDispatcherHost, message) | |
23 IPC_MESSAGE_HANDLER(NavigatorConnectHostMsg_Connect, OnConnect) | |
24 IPC_MESSAGE_UNHANDLED(handled = false) | |
25 IPC_END_MESSAGE_MAP() | |
26 return handled; | |
27 } | |
28 | |
29 void NavigatorConnectDispatcherHost::OnConnect(int thread_id, | |
30 int request_id, | |
31 const GURL& target_url, | |
32 int message_port_id) { | |
33 // 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
| |
34 | |
35 // Close port since connection fails. | |
36 MessagePortService::GetInstance()->ClosePort(message_port_id); | |
37 Send(new NavigatorConnectMsg_ConnectResult(thread_id, request_id, false)); | |
38 } | |
39 | |
40 } // namespace content | |
OLD | NEW |