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

Unified Diff: remoting/base/plugin_message_loop_proxy.cc

Issue 9427023: Add functions to expand PostDelayedTask interface. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Add function implementations in derived classes. 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
Index: remoting/base/plugin_message_loop_proxy.cc
diff --git a/remoting/base/plugin_message_loop_proxy.cc b/remoting/base/plugin_message_loop_proxy.cc
index 7cd03a4d237fb8b8a52a21888e9371528becf763..b88592d2403915330fd491f82d18148b4d74f008 100644
--- a/remoting/base/plugin_message_loop_proxy.cc
+++ b/remoting/base/plugin_message_loop_proxy.cc
@@ -28,6 +28,14 @@ bool PluginMessageLoopProxy::PostDelayedTask(
const tracked_objects::Location& from_here,
const base::Closure& task,
int64 delay_ms) {
+ return PostDelayedTask(
+ from_here, task, base::TimeDelta::FromMilliseconds(delay_ms));
+}
+
+bool PluginMessageLoopProxy::PostDelayedTask(
+ const tracked_objects::Location& from_here,
+ const base::Closure& task,
+ base::TimeDelta delay) {
base::AutoLock auto_lock(lock_);
if (!delegate_)
return false;
@@ -35,7 +43,8 @@ bool PluginMessageLoopProxy::PostDelayedTask(
base::Closure* springpad_closure = new base::Closure(base::Bind(
&PluginMessageLoopProxy::RunClosureIf, this, task));
return delegate_->RunOnPluginThread(
- delay_ms, &PluginMessageLoopProxy::TaskSpringboard, springpad_closure);
+ delay.InMilliseconds(),
jar (doing other things) 2012/02/25 02:00:22 Is this transition (to using TimeDelta) a future C
+ &PluginMessageLoopProxy::TaskSpringboard, springpad_closure);
}
bool PluginMessageLoopProxy::PostNonNestableDelayedTask(
@@ -46,6 +55,14 @@ bool PluginMessageLoopProxy::PostNonNestableDelayedTask(
return PostDelayedTask(from_here, task, delay_ms);
}
+bool PluginMessageLoopProxy::PostNonNestableDelayedTask(
+ const tracked_objects::Location& from_here,
+ const base::Closure& task,
+ base::TimeDelta delay) {
+ // All tasks running on this message loop are non-nestable.
+ return PostDelayedTask(from_here, task, delay);
+}
+
bool PluginMessageLoopProxy::RunsTasksOnCurrentThread() const {
// In pepper plugins ideally we should use pp::Core::IsMainThread,
// but it is problematic because we would need to keep reference to
« content/browser/browser_thread_impl.cc ('K') | « remoting/base/plugin_message_loop_proxy.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698