| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 if (WasTerminalIdAllocated(terminal_id)) { | 202 if (WasTerminalIdAllocated(terminal_id)) { |
| 203 LOG(ERROR) << "Invalid terminal ID: " << terminal_id; | 203 LOG(ERROR) << "Invalid terminal ID: " << terminal_id; |
| 204 CrashNetworkProcess(FROM_HERE); | 204 CrashNetworkProcess(FROM_HERE); |
| 205 return; | 205 return; |
| 206 } | 206 } |
| 207 | 207 |
| 208 // Terminal IDs cannot be reused. Update the expected next terminal ID. | 208 // Terminal IDs cannot be reused. Update the expected next terminal ID. |
| 209 next_terminal_id_ = std::max(next_terminal_id_, terminal_id + 1); | 209 next_terminal_id_ = std::max(next_terminal_id_, terminal_id + 1); |
| 210 | 210 |
| 211 // Create the desktop session. | 211 // Create the desktop session. |
| 212 scoped_ptr<DesktopSession> session = DoCreateDesktopSession( | 212 std::unique_ptr<DesktopSession> session = |
| 213 terminal_id, resolution, virtual_terminal); | 213 DoCreateDesktopSession(terminal_id, resolution, virtual_terminal); |
| 214 if (!session) { | 214 if (!session) { |
| 215 LOG(ERROR) << "Failed to create a desktop session."; | 215 LOG(ERROR) << "Failed to create a desktop session."; |
| 216 SendToNetwork( | 216 SendToNetwork( |
| 217 new ChromotingDaemonNetworkMsg_TerminalDisconnected(terminal_id)); | 217 new ChromotingDaemonNetworkMsg_TerminalDisconnected(terminal_id)); |
| 218 return; | 218 return; |
| 219 } | 219 } |
| 220 | 220 |
| 221 VLOG(1) << "Daemon: opened desktop session " << terminal_id; | 221 VLOG(1) << "Daemon: opened desktop session " << terminal_id; |
| 222 desktop_sessions_.push_back(session.release()); | 222 desktop_sessions_.push_back(session.release()); |
| 223 } | 223 } |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 } | 379 } |
| 380 | 380 |
| 381 void DaemonProcess::DeleteAllDesktopSessions() { | 381 void DaemonProcess::DeleteAllDesktopSessions() { |
| 382 while (!desktop_sessions_.empty()) { | 382 while (!desktop_sessions_.empty()) { |
| 383 delete desktop_sessions_.front(); | 383 delete desktop_sessions_.front(); |
| 384 desktop_sessions_.pop_front(); | 384 desktop_sessions_.pop_front(); |
| 385 } | 385 } |
| 386 } | 386 } |
| 387 | 387 |
| 388 } // namespace remoting | 388 } // namespace remoting |
| OLD | NEW |