Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(105)

Side by Side Diff: remoting/host/daemon_process.cc

Issue 1864213002: Convert //remoting to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Mac IWYU Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « remoting/host/daemon_process.h ('k') | remoting/host/daemon_process_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « remoting/host/daemon_process.h ('k') | remoting/host/daemon_process_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698