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

Unified Diff: remoting/base/plugin_message_loop_proxy.cc

Issue 7655006: Revert 97050 - Add PluginMessageLoopProxy and use it for Host plugin UI thread. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 4 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 | « remoting/base/plugin_message_loop_proxy.h ('k') | remoting/host/chromoting_host_context.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/base/plugin_message_loop_proxy.cc
===================================================================
--- remoting/base/plugin_message_loop_proxy.cc (revision 97052)
+++ remoting/base/plugin_message_loop_proxy.cc (working copy)
@@ -1,114 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// 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"
-
-namespace remoting {
-
-PluginMessageLoopProxy::PluginMessageLoopProxy(Delegate* delegate)
- : delegate_(delegate) {
-}
-
-PluginMessageLoopProxy::~PluginMessageLoopProxy() {
-}
-
-void PluginMessageLoopProxy::Detach() {
- base::AutoLock auto_lock(lock_);
- delegate_ = NULL;
-}
-
-// MessageLoopProxy interface implementation.
-bool PluginMessageLoopProxy::PostTask(
- const tracked_objects::Location& from_here,
- Task* task) {
- return PostDelayedTask(from_here, task, 0);
-}
-
-bool PluginMessageLoopProxy::PostDelayedTask(
- const tracked_objects::Location& from_here,
- Task* task,
- int64 delay_ms) {
- base::AutoLock auto_lock(lock_);
- if (!delegate_) {
- return false;
- } else {
- return delegate_->RunOnPluginThread(
- delay_ms, &PluginMessageLoopProxy::RunTask, task);
- }
-}
-
-bool PluginMessageLoopProxy::PostNonNestableTask(
- const tracked_objects::Location& from_here,
- Task* 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,
- Task* task,
- int64 delay_ms) {
- // All tasks running on this message loop are non-nestable.
- return PostDelayedTask(from_here, task, delay_ms);
-}
-
-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,
- int64 delay_ms) {
- base::AutoLock auto_lock(lock_);
- if (!delegate_) {
- return false;
- } else {
- base::Closure* task_on_heap = new base::Closure(task);
- return delegate_->RunOnPluginThread(
- delay_ms, &PluginMessageLoopProxy::RunClosure, task_on_heap);
- }
-}
-
-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,
- int64 delay_ms) {
- // All tasks running on this message loop are non-nestable.
- return PostDelayedTask(from_here, task, delay_ms);
-}
-
-bool PluginMessageLoopProxy::BelongsToCurrentThread() {
- base::AutoLock auto_lock(lock_);
- if (delegate_) {
- return delegate_->IsPluginThread();
- } else {
- return false;
- }
-}
-
-// static
-void PluginMessageLoopProxy::RunTask(void* data) {
- Task* task = reinterpret_cast<Task*>(data);
- task->Run();
- delete task;
-}
-
-// static
-void PluginMessageLoopProxy::RunClosure(void* data) {
- base::Closure* task = reinterpret_cast<base::Closure*>(data);
- task->Run();
- delete task;
-}
-
-} // namespace remoting
« no previous file with comments | « remoting/base/plugin_message_loop_proxy.h ('k') | remoting/host/chromoting_host_context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698