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

Unified Diff: remoting/host/desktop_process.h

Issue 11272036: Fixing threading issues in remoting::DesktopProcess. The UI thread is now owned by the caller of re… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: CR feedback. Created 8 years, 2 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 | « no previous file | remoting/host/desktop_process.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/desktop_process.h
diff --git a/remoting/host/desktop_process.h b/remoting/host/desktop_process.h
index 922640768db98eb92973a04cc85473b485ce6be1..75786b57d7ca91a8f1551eba763ee8f95861d534 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_;
« no previous file with comments | « no previous file | remoting/host/desktop_process.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698