diff options
author | alexeypa@chromium.org <alexeypa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-26 02:07:27 +0000 |
---|---|---|
committer | alexeypa@chromium.org <alexeypa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-26 02:07:27 +0000 |
commit | 2b51d74f5181a6b10903c1f5e385abf5faaf8321 (patch) | |
tree | e50751cb997c3fd2940a123e6e6d54f23b73792b /remoting/host/desktop_process.h | |
parent | ce6bee354590548102da98014062ac0fc4511762 (diff) | |
download | chromium_src-2b51d74f5181a6b10903c1f5e385abf5faaf8321.zip chromium_src-2b51d74f5181a6b10903c1f5e385abf5faaf8321.tar.gz chromium_src-2b51d74f5181a6b10903c1f5e385abf5faaf8321.tar.bz2 |
Fixing threading issues in remoting::DesktopProcess. The UI thread is now owned by the caller of remoting::DesktopThread so it can be properly shared between the caller and the class.
BUG=157808,157886
Review URL: https://codereview.chromium.org/11272036
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@164243 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/host/desktop_process.h')
-rw-r--r-- | remoting/host/desktop_process.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/remoting/host/desktop_process.h b/remoting/host/desktop_process.h index 9226407..75786b5 100644 --- a/remoting/host/desktop_process.h +++ b/remoting/host/desktop_process.h @@ -9,6 +9,7 @@ #include "base/basictypes.h" #include "base/compiler_specific.h" +#include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" #include "ipc/ipc_listener.h" @@ -18,11 +19,13 @@ class ChannelProxy; namespace remoting { +class AutoThreadTaskRunner; class DesktopSessionAgent; class DesktopProcess : public IPC::Listener { public: - explicit DesktopProcess(const std::string& daemon_channel_name); + DesktopProcess(scoped_refptr<AutoThreadTaskRunner> caller_task_runner, + const std::string& daemon_channel_name); virtual ~DesktopProcess(); // IPC::Listener implementation. @@ -30,8 +33,9 @@ class DesktopProcess : public IPC::Listener { virtual void OnChannelConnected(int32 peer_pid) OVERRIDE; virtual void OnChannelError() OVERRIDE; - // Runs the desktop process. - int Run(); + // Creates the desktop agent and required threads and IPC channels. Returns + // true on success. + bool Start(); private: // Crashes the process in response to a daemon's request. The daemon passes @@ -41,6 +45,9 @@ class DesktopProcess : public IPC::Listener { const std::string& file_name, const int& line_number); + // Task runner on which public methods of this class should be called. + scoped_refptr<AutoThreadTaskRunner> caller_task_runner_; + // Name of the IPC channel connecting the desktop process with the daemon // process. std::string daemon_channel_name_; |