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 "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 Loading... | |
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 |
OLD | NEW |