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

Side by Side Diff: remoting/base/auto_thread_task_runner.cc

Issue 2637843002: Migrate base::TaskRunner from Closure to OnceClosure (Closed)
Patch Set: rebase Created 3 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/base/auto_thread_task_runner.h" 5 #include "remoting/base/auto_thread_task_runner.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 10
11 namespace remoting { 11 namespace remoting {
12 12
13 AutoThreadTaskRunner::AutoThreadTaskRunner( 13 AutoThreadTaskRunner::AutoThreadTaskRunner(
14 scoped_refptr<base::SingleThreadTaskRunner> task_runner, 14 scoped_refptr<base::SingleThreadTaskRunner> task_runner,
15 base::Closure stop_task) 15 base::OnceClosure stop_task)
16 : stop_task_(std::move(stop_task)), task_runner_(task_runner) { 16 : stop_task_(std::move(stop_task)), task_runner_(task_runner) {
17 DCHECK(!stop_task_.is_null()); 17 DCHECK(!stop_task_.is_null());
18 } 18 }
19 19
20 bool AutoThreadTaskRunner::PostDelayedTask( 20 bool AutoThreadTaskRunner::PostDelayedTask(
21 const tracked_objects::Location& from_here, 21 const tracked_objects::Location& from_here,
22 base::Closure task, 22 base::OnceClosure task,
23 base::TimeDelta delay) { 23 base::TimeDelta delay) {
24 CHECK(task_runner_->PostDelayedTask(from_here, std::move(task), delay)); 24 CHECK(task_runner_->PostDelayedTask(from_here, std::move(task), delay));
25 return true; 25 return true;
26 } 26 }
27 27
28 bool AutoThreadTaskRunner::PostNonNestableDelayedTask( 28 bool AutoThreadTaskRunner::PostNonNestableDelayedTask(
29 const tracked_objects::Location& from_here, 29 const tracked_objects::Location& from_here,
30 base::Closure task, 30 base::OnceClosure task,
31 base::TimeDelta delay) { 31 base::TimeDelta delay) {
32 CHECK(task_runner_->PostNonNestableDelayedTask(from_here, std::move(task), 32 CHECK(task_runner_->PostNonNestableDelayedTask(from_here, std::move(task),
33 delay)); 33 delay));
34 return true; 34 return true;
35 } 35 }
36 36
37 bool AutoThreadTaskRunner::RunsTasksOnCurrentThread() const { 37 bool AutoThreadTaskRunner::RunsTasksOnCurrentThread() const {
38 return task_runner_->RunsTasksOnCurrentThread(); 38 return task_runner_->RunsTasksOnCurrentThread();
39 } 39 }
40 40
41 AutoThreadTaskRunner::~AutoThreadTaskRunner() { 41 AutoThreadTaskRunner::~AutoThreadTaskRunner() {
42 CHECK(task_runner_->PostTask(FROM_HERE, std::move(stop_task_))); 42 CHECK(task_runner_->PostTask(FROM_HERE, std::move(stop_task_)));
43 } 43 }
44 44
45 } // namespace remoting 45 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/base/auto_thread_task_runner.h ('k') | remoting/client/plugin/pepper_main_thread_task_runner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698