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/daemon_process.h" | 5 #include "remoting/host/daemon_process.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
202 // Create the desktop session. | 202 // Create the desktop session. |
203 scoped_ptr<DesktopSession> session = DoCreateDesktopSession( | 203 scoped_ptr<DesktopSession> session = DoCreateDesktopSession( |
204 terminal_id, params, virtual_terminal); | 204 terminal_id, params, virtual_terminal); |
205 if (session) { | 205 if (session) { |
206 VLOG(1) << "Daemon: opened desktop session " << terminal_id; | 206 VLOG(1) << "Daemon: opened desktop session " << terminal_id; |
207 desktop_sessions_.push_back(session.release()); | 207 desktop_sessions_.push_back(session.release()); |
208 } else { | 208 } else { |
209 LOG(ERROR) << "Failed to create a desktop session."; | 209 LOG(ERROR) << "Failed to create a desktop session."; |
210 SendToNetwork( | 210 SendToNetwork( |
211 new ChromotingDaemonNetworkMsg_TerminalDisconnected(terminal_id)); | 211 new ChromotingDaemonNetworkMsg_TerminalDisconnected(terminal_id)); |
212 return; | |
213 } | 212 } |
214 | 213 |
215 // Update the expected terminal ID. | 214 // Update the expected terminal ID. |
Wez
2013/03/12 01:21:11
nit: Consider updating the comment, e.g. The expec
alexeypa (please no reviews)
2013/03/12 20:21:15
Done. Also moved this up because |next_terminal_id
Wez
2013/03/13 22:30:27
Much nicer. :)
| |
216 next_terminal_id_ = std::max(next_terminal_id_, terminal_id + 1); | 215 next_terminal_id_ = std::max(next_terminal_id_, terminal_id + 1); |
217 } | 216 } |
218 | 217 |
219 void DaemonProcess::CrashNetworkProcess( | 218 void DaemonProcess::CrashNetworkProcess( |
220 const tracked_objects::Location& location) { | 219 const tracked_objects::Location& location) { |
221 SendToNetwork(new ChromotingDaemonNetworkMsg_Crash( | 220 SendToNetwork(new ChromotingDaemonNetworkMsg_Crash( |
222 location.function_name(), location.file_name(), location.line_number())); | 221 location.function_name(), location.file_name(), location.line_number())); |
223 | 222 |
224 DeleteAllDesktopSessions(); | 223 DeleteAllDesktopSessions(); |
225 } | 224 } |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
343 } | 342 } |
344 | 343 |
345 void DaemonProcess::DeleteAllDesktopSessions() { | 344 void DaemonProcess::DeleteAllDesktopSessions() { |
346 while (!desktop_sessions_.empty()) { | 345 while (!desktop_sessions_.empty()) { |
347 delete desktop_sessions_.front(); | 346 delete desktop_sessions_.front(); |
348 desktop_sessions_.pop_front(); | 347 desktop_sessions_.pop_front(); |
349 } | 348 } |
350 } | 349 } |
351 | 350 |
352 } // namespace remoting | 351 } // namespace remoting |
OLD | NEW |