| Index: remoting/base/plugin_thread_task_runner.cc
|
| diff --git a/remoting/base/plugin_message_loop_proxy.cc b/remoting/base/plugin_thread_task_runner.cc
|
| similarity index 70%
|
| rename from remoting/base/plugin_message_loop_proxy.cc
|
| rename to remoting/base/plugin_thread_task_runner.cc
|
| index ad595c8c9418ac889371ad087546fd0aad34876e..07637a02df0a71159e3a2762b9ef23a8c4410b44 100644
|
| --- a/remoting/base/plugin_message_loop_proxy.cc
|
| +++ b/remoting/base/plugin_thread_task_runner.cc
|
| @@ -2,21 +2,21 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#include "remoting/base/plugin_message_loop_proxy.h"
|
| +#include "remoting/base/plugin_thread_task_runner.h"
|
|
|
| #include "base/bind.h"
|
|
|
| namespace remoting {
|
|
|
| -PluginMessageLoopProxy::PluginMessageLoopProxy(Delegate* delegate)
|
| +PluginThreadTaskRunner::PluginThreadTaskRunner(Delegate* delegate)
|
| : plugin_thread_id_(base::PlatformThread::CurrentId()),
|
| delegate_(delegate) {
|
| }
|
|
|
| -PluginMessageLoopProxy::~PluginMessageLoopProxy() {
|
| +PluginThreadTaskRunner::~PluginThreadTaskRunner() {
|
| }
|
|
|
| -void PluginMessageLoopProxy::Detach() {
|
| +void PluginThreadTaskRunner::Detach() {
|
| base::AutoLock auto_lock(lock_);
|
| if (delegate_) {
|
| DCHECK(BelongsToCurrentThread());
|
| @@ -24,7 +24,7 @@ void PluginMessageLoopProxy::Detach() {
|
| }
|
| }
|
|
|
| -bool PluginMessageLoopProxy::PostDelayedTask(
|
| +bool PluginThreadTaskRunner::PostDelayedTask(
|
| const tracked_objects::Location& from_here,
|
| const base::Closure& task,
|
| base::TimeDelta delay) {
|
| @@ -33,12 +33,12 @@ bool PluginMessageLoopProxy::PostDelayedTask(
|
| return false;
|
|
|
| base::Closure* springpad_closure = new base::Closure(base::Bind(
|
| - &PluginMessageLoopProxy::RunClosureIf, this, task));
|
| + &PluginThreadTaskRunner::RunClosureIf, this, task));
|
| return delegate_->RunOnPluginThread(
|
| - delay, &PluginMessageLoopProxy::TaskSpringboard, springpad_closure);
|
| + delay, &PluginThreadTaskRunner::TaskSpringboard, springpad_closure);
|
| }
|
|
|
| -bool PluginMessageLoopProxy::PostNonNestableDelayedTask(
|
| +bool PluginThreadTaskRunner::PostNonNestableDelayedTask(
|
| const tracked_objects::Location& from_here,
|
| const base::Closure& task,
|
| base::TimeDelta delay) {
|
| @@ -46,7 +46,7 @@ bool PluginMessageLoopProxy::PostNonNestableDelayedTask(
|
| return PostDelayedTask(from_here, task, delay);
|
| }
|
|
|
| -bool PluginMessageLoopProxy::RunsTasksOnCurrentThread() const {
|
| +bool PluginThreadTaskRunner::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.
|
| @@ -54,13 +54,13 @@ bool PluginMessageLoopProxy::RunsTasksOnCurrentThread() const {
|
| }
|
|
|
| // static
|
| -void PluginMessageLoopProxy::TaskSpringboard(void* data) {
|
| +void PluginThreadTaskRunner::TaskSpringboard(void* data) {
|
| base::Closure* task = reinterpret_cast<base::Closure*>(data);
|
| task->Run();
|
| delete task;
|
| }
|
|
|
| -void PluginMessageLoopProxy::RunClosureIf(const base::Closure& task) {
|
| +void PluginThreadTaskRunner::RunClosureIf(const base::Closure& task) {
|
| // |delegate_| can be changed only from our thread, so it's safe to
|
| // access it without acquiring |lock_|.
|
| if (delegate_)
|
|
|