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

Unified Diff: base/threading/post_task_and_reply_impl.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/threading/post_task_and_reply_impl.h ('k') | base/threading/worker_pool.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/threading/post_task_and_reply_impl.cc
diff --git a/base/threading/post_task_and_reply_impl.cc b/base/threading/post_task_and_reply_impl.cc
index a82a4fd804386bddaaafafab8c53543c6772e09e..a883f9ef925210c87a1c8e3b919255465743065c 100644
--- a/base/threading/post_task_and_reply_impl.cc
+++ b/base/threading/post_task_and_reply_impl.cc
@@ -6,6 +6,7 @@
#include "base/bind.h"
#include "base/location.h"
+#include "base/logging.h"
#include "base/single_thread_task_runner.h"
#include "base/thread_task_runner_handle.h"
@@ -86,6 +87,22 @@ bool PostTaskAndReplyImpl::PostTaskAndReply(
return true;
}
+bool PostTaskAndReplyImpl::PostDelayedTaskAndReply(
+ const tracked_objects::Location& from_here,
+ const Closure& task,
+ const Closure& reply,
+ const TimeDelta& delay) {
+ PostTaskAndReplyRelay* relay =
+ new PostTaskAndReplyRelay(from_here, task, reply);
+ if (!PostDelayedTask(from_here, Bind(&PostTaskAndReplyRelay::Run,
+ Unretained(relay)), delay)) {
+ delete relay;
+ return false;
+ }
+
+ return true;
+}
+
} // namespace internal
} // namespace base
« no previous file with comments | « base/threading/post_task_and_reply_impl.h ('k') | base/threading/worker_pool.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698