summaryrefslogtreecommitdiffstats
path: root/remoting
diff options
context:
space:
mode:
authorakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-15 01:43:19 +0000
committerakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-15 01:43:19 +0000
commit6b28d9469f63df13c9918d5f2d8d24ba8b9893a5 (patch)
tree195a09586b5388359914e63ebeca1aa66a2516fe /remoting
parent1005065913ee5ced3fd8fc915d31e0c0461e2b1d (diff)
downloadchromium_src-6b28d9469f63df13c9918d5f2d8d24ba8b9893a5.zip
chromium_src-6b28d9469f63df13c9918d5f2d8d24ba8b9893a5.tar.gz
chromium_src-6b28d9469f63df13c9918d5f2d8d24ba8b9893a5.tar.bz2
Make new TaskRunner, SequencedTaskRunner, and SingleThreadTaskRunner interfaces
TaskRunner just has Post{,Delayed}Task(), SequencedTaskRunner extends Executor to have ordering guarantees and PostNonNestable{,Delayed}Task(), and SingleThreadTaskRunner extends SequencedTaskRunner and guarantees execution on a single thread. Move a bunch of methods from MessageLoopProxy into the TaskRunner classes and make it inherit from SingleThreadTaskRunner. BUG=110973 TEST= Review URL: https://chromiumcodereview.appspot.com/9169037 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@121999 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting')
-rw-r--r--remoting/base/plugin_message_loop_proxy.cc15
-rw-r--r--remoting/base/plugin_message_loop_proxy.h8
2 files changed, 2 insertions, 21 deletions
diff --git a/remoting/base/plugin_message_loop_proxy.cc b/remoting/base/plugin_message_loop_proxy.cc
index b3bc453..7cd03a4 100644
--- a/remoting/base/plugin_message_loop_proxy.cc
+++ b/remoting/base/plugin_message_loop_proxy.cc
@@ -24,12 +24,6 @@ void PluginMessageLoopProxy::Detach() {
}
}
-bool PluginMessageLoopProxy::PostTask(
- const tracked_objects::Location& from_here,
- const base::Closure& task) {
- return PostDelayedTask(from_here, task, 0);
-}
-
bool PluginMessageLoopProxy::PostDelayedTask(
const tracked_objects::Location& from_here,
const base::Closure& task,
@@ -44,13 +38,6 @@ bool PluginMessageLoopProxy::PostDelayedTask(
delay_ms, &PluginMessageLoopProxy::TaskSpringboard, springpad_closure);
}
-bool PluginMessageLoopProxy::PostNonNestableTask(
- const tracked_objects::Location& from_here,
- const base::Closure& task) {
- // All tasks running on this message loop are non-nestable.
- return PostTask(from_here, task);
-}
-
bool PluginMessageLoopProxy::PostNonNestableDelayedTask(
const tracked_objects::Location& from_here,
const base::Closure& task,
@@ -59,7 +46,7 @@ bool PluginMessageLoopProxy::PostNonNestableDelayedTask(
return PostDelayedTask(from_here, task, delay_ms);
}
-bool PluginMessageLoopProxy::BelongsToCurrentThread() {
+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
// Core somewhere, e.g. make the delegate ref-counted.
diff --git a/remoting/base/plugin_message_loop_proxy.h b/remoting/base/plugin_message_loop_proxy.h
index 19082a0..855134f 100644
--- a/remoting/base/plugin_message_loop_proxy.h
+++ b/remoting/base/plugin_message_loop_proxy.h
@@ -32,22 +32,16 @@ class PluginMessageLoopProxy : public base::MessageLoopProxy {
void Detach();
// base::MessageLoopProxy implementation.
- virtual bool PostTask(
- const tracked_objects::Location& from_here,
- const base::Closure& task) OVERRIDE;
virtual bool PostDelayedTask(
const tracked_objects::Location& from_here,
const base::Closure& task,
int64 delay_ms) OVERRIDE;
- virtual bool PostNonNestableTask(
- const tracked_objects::Location& from_here,
- const base::Closure& task) OVERRIDE;
virtual bool PostNonNestableDelayedTask(
const tracked_objects::Location& from_here,
const base::Closure& task,
int64 delay_ms) OVERRIDE;
- virtual bool BelongsToCurrentThread() OVERRIDE;
+ virtual bool RunsTasksOnCurrentThread() const OVERRIDE;
private:
static void TaskSpringboard(void* data);