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

Unified Diff: remoting/host/ipc_desktop_environment.h

Issue 11231060: [Chromoting] The desktop process now creates a pre-connected pipe and passes (with some help of the… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased 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 | « remoting/host/desktop_session_win.cc ('k') | remoting/host/ipc_desktop_environment.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/ipc_desktop_environment.h
diff --git a/remoting/host/ipc_desktop_environment.h b/remoting/host/ipc_desktop_environment.h
index d27235bcb38c9cbf99c620fab42ce828e18ea8ad..d65495fb0c644ca08d760c7c41b2071e28129fd9 100644
--- a/remoting/host/ipc_desktop_environment.h
+++ b/remoting/host/ipc_desktop_environment.h
@@ -8,12 +8,18 @@
#include "base/basictypes.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
+#include "ipc/ipc_listener.h"
+#include "ipc/ipc_platform_file.h"
#include "remoting/host/desktop_environment.h"
namespace base {
class SingleThreadTaskRunner;
} // base
+namespace IPC {
+class ChannelProxy;
+} // base
+
namespace remoting {
class ClientSession;
@@ -21,7 +27,7 @@ class DesktopSessionConnector;
// A variant of desktop environment integrating with the desktop by means of
// a helper process and talking to that process via IPC.
-class IpcDesktopEnvironment : public DesktopEnvironment {
+class IpcDesktopEnvironment : public DesktopEnvironment, public IPC::Listener {
public:
// |desktop_session_connector| is used to bind the IpcDesktopEnvironment to
// a desktop session, to be notified with a new IPC channel every time
@@ -29,18 +35,34 @@ class IpcDesktopEnvironment : public DesktopEnvironment {
// |this|. |client| specifies the client session owning |this|.
IpcDesktopEnvironment(
scoped_refptr<base::SingleThreadTaskRunner> input_task_runner,
+ scoped_refptr<base::SingleThreadTaskRunner> network_task_runner,
scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner,
DesktopSessionConnector* desktop_session_connector,
ClientSession* client);
virtual ~IpcDesktopEnvironment();
+ // IPC::Listener implementation.
+ virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
+ virtual void OnChannelConnected(int32 peer_pid) OVERRIDE;
+ virtual void OnChannelError() OVERRIDE;
+
virtual void Start(
scoped_ptr<protocol::ClipboardStub> client_clipboard) OVERRIDE;
// Disconnects the client session that owns |this|.
void DisconnectClient();
+ // Notifies |this| that it is now attached to a desktop integration process.
+ // |desktop_process| specifies the process handle. |desktop_pipe| is
+ // the client end of the pipe opened by the desktop process.
+ void OnDesktopSessionAgentAttached(
+ IPC::PlatformFileForTransit desktop_process,
+ IPC::PlatformFileForTransit desktop_pipe);
+
private:
+ // Used for IPC I/O.
+ scoped_refptr<base::SingleThreadTaskRunner> network_task_runner_;
+
DesktopSessionConnector* desktop_session_connector_;
// Specifies the client session that owns |this|.
@@ -49,6 +71,9 @@ class IpcDesktopEnvironment : public DesktopEnvironment {
// True if |this| has been connected to a desktop session.
bool connected_;
+ // Connects |this| with the desktop process.
+ scoped_ptr<IPC::ChannelProxy> desktop_channel_;
+
DISALLOW_COPY_AND_ASSIGN(IpcDesktopEnvironment);
};
« no previous file with comments | « remoting/host/desktop_session_win.cc ('k') | remoting/host/ipc_desktop_environment.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698