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

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

Issue 1064863004: Use base::ResetAndReturn() in remoting. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
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"
11 #include "base/bind_helpers.h" 11 #include "base/bind_helpers.h"
12 #include "base/callback_helpers.h"
12 #include "base/command_line.h" 13 #include "base/command_line.h"
13 #include "base/files/file_path.h" 14 #include "base/files/file_path.h"
14 #include "base/files/file_util.h" 15 #include "base/files/file_util.h"
15 #include "base/location.h" 16 #include "base/location.h"
16 #include "base/single_thread_task_runner.h" 17 #include "base/single_thread_task_runner.h"
17 #include "net/base/net_util.h" 18 #include "net/base/net_util.h"
18 #include "remoting/base/auto_thread_task_runner.h" 19 #include "remoting/base/auto_thread_task_runner.h"
19 #include "remoting/host/branding.h" 20 #include "remoting/host/branding.h"
20 #include "remoting/host/chromoting_messages.h" 21 #include "remoting/host/chromoting_messages.h"
21 #include "remoting/host/config_file_watcher.h" 22 #include "remoting/host/config_file_watcher.h"
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 HostEventLogger::Create(weak_factory_.GetWeakPtr(), kApplicationName); 279 HostEventLogger::Create(weak_factory_.GetWeakPtr(), kApplicationName);
279 280
280 // Launch the process. 281 // Launch the process.
281 LaunchNetworkProcess(); 282 LaunchNetworkProcess();
282 } 283 }
283 284
284 void DaemonProcess::Stop() { 285 void DaemonProcess::Stop() {
285 DCHECK(caller_task_runner()->BelongsToCurrentThread()); 286 DCHECK(caller_task_runner()->BelongsToCurrentThread());
286 287
287 if (!stopped_callback_.is_null()) { 288 if (!stopped_callback_.is_null()) {
288 base::Closure stopped_callback = stopped_callback_; 289 base::ResetAndReturn(&stopped_callback_).Run();
289 stopped_callback_.Reset();
290 stopped_callback.Run();
291 } 290 }
292 } 291 }
293 292
294 bool DaemonProcess::WasTerminalIdAllocated(int terminal_id) { 293 bool DaemonProcess::WasTerminalIdAllocated(int terminal_id) {
295 return terminal_id < next_terminal_id_; 294 return terminal_id < next_terminal_id_;
296 } 295 }
297 296
298 void DaemonProcess::OnAccessDenied(const std::string& jid) { 297 void DaemonProcess::OnAccessDenied(const std::string& jid) {
299 DCHECK(caller_task_runner()->BelongsToCurrentThread()); 298 DCHECK(caller_task_runner()->BelongsToCurrentThread());
300 299
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 } 373 }
375 374
376 void DaemonProcess::DeleteAllDesktopSessions() { 375 void DaemonProcess::DeleteAllDesktopSessions() {
377 while (!desktop_sessions_.empty()) { 376 while (!desktop_sessions_.empty()) {
378 delete desktop_sessions_.front(); 377 delete desktop_sessions_.front();
379 desktop_sessions_.pop_front(); 378 desktop_sessions_.pop_front();
380 } 379 }
381 } 380 }
382 381
383 } // namespace remoting 382 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698