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 #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 |
OLD | NEW |