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

Unified Diff: base/task_runner.cc

Issue 1048373003: CancelableTaskTracker::PostDelayedTask() support (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove unnecessary base:: Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/task_runner.h ('k') | base/threading/post_task_and_reply_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/task_runner.cc
diff --git a/base/task_runner.cc b/base/task_runner.cc
index 262e1f8b09eac8d9f91b4113ddeccc27a33323ad..52ac0bb5ee2364d09ba360fdec463a9474b613b9 100644
--- a/base/task_runner.cc
+++ b/base/task_runner.cc
@@ -7,6 +7,7 @@
#include "base/compiler_specific.h"
#include "base/logging.h"
#include "base/threading/post_task_and_reply_impl.h"
+#include "base/time/time.h"
namespace base {
@@ -22,6 +23,8 @@ class PostTaskAndReplyTaskRunner : public internal::PostTaskAndReplyImpl {
private:
bool PostTask(const tracked_objects::Location& from_here,
const Closure& task) override;
+ bool PostDelayedTask(const tracked_objects::Location& from_here,
+ const Closure& task, const TimeDelta& delay) override;
// Non-owning.
TaskRunner* destination_;
@@ -38,11 +41,18 @@ bool PostTaskAndReplyTaskRunner::PostTask(
return destination_->PostTask(from_here, task);
}
+bool PostTaskAndReplyTaskRunner::PostDelayedTask(
+ const tracked_objects::Location& from_here,
+ const Closure& task,
+ const TimeDelta& delay) {
+ return destination_->PostDelayedTask(from_here, task, delay);
+}
+
} // namespace
bool TaskRunner::PostTask(const tracked_objects::Location& from_here,
const Closure& task) {
- return PostDelayedTask(from_here, task, base::TimeDelta());
+ return PostDelayedTask(from_here, task, TimeDelta());
}
bool TaskRunner::PostTaskAndReply(
@@ -53,6 +63,15 @@ bool TaskRunner::PostTaskAndReply(
from_here, task, reply);
}
+bool TaskRunner::PostDelayedTaskAndReply(
+ const tracked_objects::Location& from_here,
+ const Closure& task,
+ const Closure& reply,
+ const TimeDelta& delay) {
+ return PostTaskAndReplyTaskRunner(this).PostDelayedTaskAndReply(
+ from_here, task, reply, delay);
+}
+
TaskRunner::TaskRunner() {}
TaskRunner::~TaskRunner() {}
« no previous file with comments | « base/task_runner.h ('k') | base/threading/post_task_and_reply_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698