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

Side by Side Diff: base/task_runner.cc

Issue 2823103003: Introduce TaskRunner::RunsTasksInCurrentSequence() (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
« no previous file with comments | « base/task_runner.h ('k') | base/task_scheduler/scheduler_single_thread_task_runner_manager.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 "base/task_runner.h" 5 #include "base/task_runner.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 return PostDelayedTask(from_here, std::move(task), base::TimeDelta()); 47 return PostDelayedTask(from_here, std::move(task), base::TimeDelta());
48 } 48 }
49 49
50 bool TaskRunner::PostTaskAndReply(const tracked_objects::Location& from_here, 50 bool TaskRunner::PostTaskAndReply(const tracked_objects::Location& from_here,
51 OnceClosure task, 51 OnceClosure task,
52 OnceClosure reply) { 52 OnceClosure reply) {
53 return PostTaskAndReplyTaskRunner(this).PostTaskAndReply( 53 return PostTaskAndReplyTaskRunner(this).PostTaskAndReply(
54 from_here, std::move(task), std::move(reply)); 54 from_here, std::move(task), std::move(reply));
55 } 55 }
56 56
57 bool TaskRunner::RunsTasksOnCurrentThread() const {
58 return RunsTasksInCurrentSequence();
gab 2017/04/26 15:03:05 Actually, let's move this implementation in the he
gab 2017/04/27 14:31:17 FYI: You want to reply "Done." specifically on the
59 }
60
57 TaskRunner::TaskRunner() {} 61 TaskRunner::TaskRunner() {}
58 62
59 TaskRunner::~TaskRunner() {} 63 TaskRunner::~TaskRunner() {}
60 64
61 void TaskRunner::OnDestruct() const { 65 void TaskRunner::OnDestruct() const {
62 delete this; 66 delete this;
63 } 67 }
64 68
65 void TaskRunnerTraits::Destruct(const TaskRunner* task_runner) { 69 void TaskRunnerTraits::Destruct(const TaskRunner* task_runner) {
66 task_runner->OnDestruct(); 70 task_runner->OnDestruct();
67 } 71 }
68 72
69 } // namespace base 73 } // namespace base
OLDNEW
« no previous file with comments | « base/task_runner.h ('k') | base/task_scheduler/scheduler_single_thread_task_runner_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698