OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2012 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 "remoting/host/desktop_session_agent.h" |
| 6 |
| 7 #include "base/logging.h" |
| 8 #include "ipc/ipc_channel_proxy.h" |
| 9 #include "ipc/ipc_message.h" |
| 10 #include "ipc/ipc_message_macros.h" |
| 11 #include "remoting/base/auto_thread_task_runner.h" |
| 12 #include "remoting/host/chromoting_messages.h" |
| 13 |
| 14 namespace remoting { |
| 15 |
| 16 DesktopSessionAgent::~DesktopSessionAgent() { |
| 17 DCHECK(caller_task_runner()->BelongsToCurrentThread()); |
| 18 } |
| 19 |
| 20 bool DesktopSessionAgent::OnMessageReceived(const IPC::Message& message) { |
| 21 DCHECK(caller_task_runner()->BelongsToCurrentThread()); |
| 22 |
| 23 NOTIMPLEMENTED(); |
| 24 return false; |
| 25 } |
| 26 |
| 27 void DesktopSessionAgent::OnChannelConnected(int32 peer_pid) { |
| 28 DCHECK(caller_task_runner()->BelongsToCurrentThread()); |
| 29 |
| 30 VLOG(1) << "IPC: desktop <- network (" << peer_pid << ")"; |
| 31 |
| 32 NOTIMPLEMENTED(); |
| 33 } |
| 34 |
| 35 void DesktopSessionAgent::OnChannelError() { |
| 36 DCHECK(caller_task_runner()->BelongsToCurrentThread()); |
| 37 |
| 38 // Make sure the channel is closed. |
| 39 network_channel_.reset(); |
| 40 |
| 41 // Notify the caller that |this| can be destroyed now. |
| 42 done_task_.Run(); |
| 43 } |
| 44 |
| 45 bool DesktopSessionAgent::Start(const base::Closure& done_task, |
| 46 IPC::PlatformFileForTransit* desktop_pipe_out) { |
| 47 DCHECK(caller_task_runner()->BelongsToCurrentThread()); |
| 48 |
| 49 done_task_ = done_task; |
| 50 return DoCreateNetworkChannel(desktop_pipe_out, &network_channel_); |
| 51 } |
| 52 |
| 53 DesktopSessionAgent::DesktopSessionAgent( |
| 54 scoped_refptr<AutoThreadTaskRunner> caller_task_runner, |
| 55 scoped_refptr<AutoThreadTaskRunner> io_task_runner) |
| 56 : caller_task_runner_(caller_task_runner), |
| 57 io_task_runner_(io_task_runner) { |
| 58 DCHECK(caller_task_runner_->BelongsToCurrentThread()); |
| 59 } |
| 60 |
| 61 } // namespace remoting |
OLD | NEW |