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

Unified Diff: base/message_loop_proxy_impl.cc

Issue 9427023: Add functions to expand PostDelayedTask interface. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Add fix to RunOnPluginThread() in host_plugin.cc Created 8 years, 10 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/message_loop_proxy_impl.h ('k') | base/sequenced_task_runner.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/message_loop_proxy_impl.cc
diff --git a/base/message_loop_proxy_impl.cc b/base/message_loop_proxy_impl.cc
index eeeb1db8bfc3405d719928d6c7f41cbc9f1a567a..9f6cb1f6e23073737e37cdc8e32946c45d7372b8 100644
--- a/base/message_loop_proxy_impl.cc
+++ b/base/message_loop_proxy_impl.cc
@@ -12,18 +12,36 @@ namespace base {
MessageLoopProxyImpl::~MessageLoopProxyImpl() {
}
+// This function will be removed later in the fixing of CR Bug #108171.
bool MessageLoopProxyImpl::PostDelayedTask(
const tracked_objects::Location& from_here,
const base::Closure& task,
int64 delay_ms) {
- return PostTaskHelper(from_here, task, delay_ms, true);
+ return PostDelayedTask(
+ from_here, task, base::TimeDelta::FromMilliseconds(delay_ms));
}
+// This function will be removed later in the fixing of CR Bug #108171.
bool MessageLoopProxyImpl::PostNonNestableDelayedTask(
const tracked_objects::Location& from_here,
const base::Closure& task,
int64 delay_ms) {
- return PostTaskHelper(from_here, task, delay_ms, false);
+ return PostNonNestableDelayedTask(
+ from_here, task, base::TimeDelta::FromMilliseconds(delay_ms));
+}
+
+bool MessageLoopProxyImpl::PostDelayedTask(
+ const tracked_objects::Location& from_here,
+ const base::Closure& task,
+ base::TimeDelta delay) {
+ return PostTaskHelper(from_here, task, delay, true);
+}
+
+bool MessageLoopProxyImpl::PostNonNestableDelayedTask(
+ const tracked_objects::Location& from_here,
+ const base::Closure& task,
+ base::TimeDelta delay) {
+ return PostTaskHelper(from_here, task, delay, false);
}
bool MessageLoopProxyImpl::RunsTasksOnCurrentThread() const {
@@ -68,10 +86,9 @@ MessageLoopProxyImpl::MessageLoopProxyImpl()
bool MessageLoopProxyImpl::PostTaskHelper(
const tracked_objects::Location& from_here, const base::Closure& task,
- int64 delay_ms, bool nestable) {
+ base::TimeDelta delay, bool nestable) {
AutoLock lock(message_loop_lock_);
if (target_message_loop_) {
- base::TimeDelta delay = base::TimeDelta::FromMilliseconds(delay_ms);
if (nestable) {
target_message_loop_->PostDelayedTask(from_here, task, delay);
} else {
« no previous file with comments | « base/message_loop_proxy_impl.h ('k') | base/sequenced_task_runner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698