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

Unified Diff: remoting/host/chromoting_host_context.h

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.cc ('k') | remoting/host/chromoting_host_context.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/chromoting_host_context.h
===================================================================
--- remoting/host/chromoting_host_context.h (revision 97052)
+++ remoting/host/chromoting_host_context.h (working copy)
@@ -25,8 +25,12 @@
// process. This class is virtual only for testing purposes (see below).
class ChromotingHostContext {
public:
+ typedef base::Callback<void(
+ const tracked_objects::Location& from_here,
+ const base::Closure& task)> UIThreadPostTaskFunction;
+
// Create a context.
- ChromotingHostContext(base::MessageLoopProxy* ui_message_loop);
+ ChromotingHostContext();
virtual ~ChromotingHostContext();
// TODO(ajwong): Move the Start/Stop methods out of this class. Then
@@ -38,12 +42,21 @@
virtual JingleThread* jingle_thread();
- virtual base::MessageLoopProxy* ui_message_loop();
virtual MessageLoop* main_message_loop();
virtual MessageLoop* encode_message_loop();
virtual base::MessageLoopProxy* network_message_loop();
virtual MessageLoop* desktop_message_loop();
+ // Must be called from the main GUI thread.
+ void SetUITaskPostFunction(const UIThreadPostTaskFunction& poster);
+
+ void PostTaskToUIThread(const tracked_objects::Location& from_here,
+ const base::Closure& task);
+ void PostDelayedTaskToUIThread(const tracked_objects::Location& from_here,
+ const base::Closure& task,
+ int delay_ms);
+ bool IsUIThread() const;
+
private:
FRIEND_TEST_ALL_PREFIXES(ChromotingHostContextTest, StartAndStop);
@@ -60,8 +73,11 @@
// This is NOT a Chrome-style UI thread.
base::Thread desktop_thread_;
- scoped_refptr<base::MessageLoopProxy> ui_message_loop_;
+ UIThreadPostTaskFunction ui_poster_;
+ // This IS the main Chrome GUI thread that |ui_poster_| will post to.
+ base::PlatformThreadId ui_main_thread_id_;
+
DISALLOW_COPY_AND_ASSIGN(ChromotingHostContext);
};
« no previous file with comments | « remoting/base/plugin_message_loop_proxy.cc ('k') | remoting/host/chromoting_host_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698