OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "remoting/host/desktop_session_agent.h" | 5 #include "remoting/host/desktop_session_agent.h" |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "ipc/ipc_channel_proxy.h" | 9 #include "ipc/ipc_channel_proxy.h" |
10 #include "ipc/ipc_message.h" | 10 #include "ipc/ipc_message.h" |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 IPC_MESSAGE_UNHANDLED(handled = false) | 96 IPC_MESSAGE_UNHANDLED(handled = false) |
97 IPC_END_MESSAGE_MAP() | 97 IPC_END_MESSAGE_MAP() |
98 } else { | 98 } else { |
99 IPC_BEGIN_MESSAGE_MAP(DesktopSessionAgent, message) | 99 IPC_BEGIN_MESSAGE_MAP(DesktopSessionAgent, message) |
100 IPC_MESSAGE_HANDLER(ChromotingNetworkDesktopMsg_StartSessionAgent, | 100 IPC_MESSAGE_HANDLER(ChromotingNetworkDesktopMsg_StartSessionAgent, |
101 OnStartSessionAgent) | 101 OnStartSessionAgent) |
102 IPC_MESSAGE_UNHANDLED(handled = false) | 102 IPC_MESSAGE_UNHANDLED(handled = false) |
103 IPC_END_MESSAGE_MAP() | 103 IPC_END_MESSAGE_MAP() |
104 } | 104 } |
105 | 105 |
106 // Close the channel if the received message wasn't expected. | 106 CHECK(handled) << "Received unexpected IPC type: " << message.type(); |
107 if (!handled) { | |
108 LOG(ERROR) << "An unexpected IPC message received: type=" << message.type(); | |
109 OnChannelError(); | |
110 } | |
111 | |
112 return handled; | 107 return handled; |
113 } | 108 } |
114 | 109 |
115 void DesktopSessionAgent::OnChannelConnected(int32 peer_pid) { | 110 void DesktopSessionAgent::OnChannelConnected(int32 peer_pid) { |
116 DCHECK(caller_task_runner()->BelongsToCurrentThread()); | 111 DCHECK(caller_task_runner()->BelongsToCurrentThread()); |
117 | 112 |
118 VLOG(1) << "IPC: desktop <- network (" << peer_pid << ")"; | 113 VLOG(1) << "IPC: desktop <- network (" << peer_pid << ")"; |
119 | 114 |
120 CloseDesktopPipeHandle(); | 115 CloseDesktopPipeHandle(); |
121 } | 116 } |
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
531 base::ClosePlatformFile(desktop_pipe_.fd); | 526 base::ClosePlatformFile(desktop_pipe_.fd); |
532 #else // !defined(OS_POSIX) | 527 #else // !defined(OS_POSIX) |
533 #error Unsupported platform. | 528 #error Unsupported platform. |
534 #endif // !defined(OS_POSIX) | 529 #endif // !defined(OS_POSIX) |
535 | 530 |
536 desktop_pipe_ = IPC::InvalidPlatformFileForTransit(); | 531 desktop_pipe_ = IPC::InvalidPlatformFileForTransit(); |
537 } | 532 } |
538 } | 533 } |
539 | 534 |
540 } // namespace remoting | 535 } // namespace remoting |
OLD | NEW |