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 // This file implements the Windows service controlling Me2Me host processes | 5 // This file implements the Windows service controlling Me2Me host processes |
6 // running within user sessions. | 6 // running within user sessions. |
7 | 7 |
8 #include "remoting/host/desktop_process.h" | 8 #include "remoting/host/desktop_process.h" |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
11 #include "base/bind_helpers.h" | 11 #include "base/bind_helpers.h" |
| 12 #include "base/debug/alias.h" |
12 #include "base/logging.h" | 13 #include "base/logging.h" |
13 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
14 #include "base/message_loop.h" | 15 #include "base/message_loop.h" |
| 16 #include "base/string_util.h" |
15 #include "ipc/ipc_channel_proxy.h" | 17 #include "ipc/ipc_channel_proxy.h" |
16 #include "remoting/base/auto_thread.h" | 18 #include "remoting/base/auto_thread.h" |
17 #include "remoting/base/auto_thread_task_runner.h" | 19 #include "remoting/base/auto_thread_task_runner.h" |
18 #include "remoting/host/chromoting_messages.h" | 20 #include "remoting/host/chromoting_messages.h" |
19 #include "remoting/host/desktop_environment.h" | 21 #include "remoting/host/desktop_environment.h" |
20 #include "remoting/host/desktop_session_agent.h" | 22 #include "remoting/host/desktop_session_agent.h" |
21 | 23 |
22 namespace remoting { | 24 namespace remoting { |
23 | 25 |
24 DesktopProcess::DesktopProcess( | 26 DesktopProcess::DesktopProcess( |
(...skipping 26 matching lines...) Expand all Loading... |
51 DCHECK(caller_task_runner_->BelongsToCurrentThread()); | 53 DCHECK(caller_task_runner_->BelongsToCurrentThread()); |
52 | 54 |
53 daemon_channel_->Send(new ChromotingDesktopDaemonMsg_InjectSas()); | 55 daemon_channel_->Send(new ChromotingDesktopDaemonMsg_InjectSas()); |
54 } | 56 } |
55 | 57 |
56 bool DesktopProcess::OnMessageReceived(const IPC::Message& message) { | 58 bool DesktopProcess::OnMessageReceived(const IPC::Message& message) { |
57 DCHECK(caller_task_runner_->BelongsToCurrentThread()); | 59 DCHECK(caller_task_runner_->BelongsToCurrentThread()); |
58 | 60 |
59 bool handled = true; | 61 bool handled = true; |
60 IPC_BEGIN_MESSAGE_MAP(DesktopProcess, message) | 62 IPC_BEGIN_MESSAGE_MAP(DesktopProcess, message) |
61 IPC_MESSAGE_HANDLER(ChromotingDaemonDesktopMsg_Crash, OnCrash) | 63 IPC_MESSAGE_HANDLER(ChromotingDaemonMsg_Crash, OnCrash) |
62 IPC_MESSAGE_UNHANDLED(handled = false) | 64 IPC_MESSAGE_UNHANDLED(handled = false) |
63 IPC_END_MESSAGE_MAP() | 65 IPC_END_MESSAGE_MAP() |
64 | 66 |
65 CHECK(handled) << "Received unexpected IPC type: " << message.type(); | 67 CHECK(handled) << "Received unexpected IPC type: " << message.type(); |
66 return handled; | 68 return handled; |
67 } | 69 } |
68 | 70 |
69 void DesktopProcess::OnChannelConnected(int32 peer_pid) { | 71 void DesktopProcess::OnChannelConnected(int32 peer_pid) { |
70 DCHECK(caller_task_runner_->BelongsToCurrentThread()); | 72 DCHECK(caller_task_runner_->BelongsToCurrentThread()); |
71 | 73 |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 // Pass |desktop_pipe| to the daemon. | 144 // Pass |desktop_pipe| to the daemon. |
143 daemon_channel_->Send( | 145 daemon_channel_->Send( |
144 new ChromotingDesktopDaemonMsg_DesktopAttached(desktop_pipe)); | 146 new ChromotingDesktopDaemonMsg_DesktopAttached(desktop_pipe)); |
145 | 147 |
146 return true; | 148 return true; |
147 } | 149 } |
148 | 150 |
149 void DesktopProcess::OnCrash(const std::string& function_name, | 151 void DesktopProcess::OnCrash(const std::string& function_name, |
150 const std::string& file_name, | 152 const std::string& file_name, |
151 const int& line_number) { | 153 const int& line_number) { |
| 154 char message[1024]; |
| 155 base::snprintf(message, sizeof(message), |
| 156 "Requested by %s at %s, line %d.", |
| 157 function_name.c_str(), file_name.c_str(), line_number); |
| 158 base::debug::Alias(message); |
| 159 |
152 // The daemon requested us to crash the process. | 160 // The daemon requested us to crash the process. |
153 CHECK(false); | 161 CHECK(false) << message; |
154 } | 162 } |
155 | 163 |
156 } // namespace remoting | 164 } // namespace remoting |
OLD | NEW |