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

Side by Side 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, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « remoting/host/desktop_session_win.cc ('k') | remoting/host/ipc_desktop_environment.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef REMOTING_HOST_IPC_DESKTOP_ENVIRONMENT_H_ 5 #ifndef REMOTING_HOST_IPC_DESKTOP_ENVIRONMENT_H_
6 #define REMOTING_HOST_IPC_DESKTOP_ENVIRONMENT_H_ 6 #define REMOTING_HOST_IPC_DESKTOP_ENVIRONMENT_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
11 #include "ipc/ipc_listener.h"
12 #include "ipc/ipc_platform_file.h"
11 #include "remoting/host/desktop_environment.h" 13 #include "remoting/host/desktop_environment.h"
12 14
13 namespace base { 15 namespace base {
14 class SingleThreadTaskRunner; 16 class SingleThreadTaskRunner;
15 } // base 17 } // base
16 18
19 namespace IPC {
20 class ChannelProxy;
21 } // base
22
17 namespace remoting { 23 namespace remoting {
18 24
19 class ClientSession; 25 class ClientSession;
20 class DesktopSessionConnector; 26 class DesktopSessionConnector;
21 27
22 // A variant of desktop environment integrating with the desktop by means of 28 // A variant of desktop environment integrating with the desktop by means of
23 // a helper process and talking to that process via IPC. 29 // a helper process and talking to that process via IPC.
24 class IpcDesktopEnvironment : public DesktopEnvironment { 30 class IpcDesktopEnvironment : public DesktopEnvironment, public IPC::Listener {
25 public: 31 public:
26 // |desktop_session_connector| is used to bind the IpcDesktopEnvironment to 32 // |desktop_session_connector| is used to bind the IpcDesktopEnvironment to
27 // a desktop session, to be notified with a new IPC channel every time 33 // a desktop session, to be notified with a new IPC channel every time
28 // the desktop process is changed. |desktop_session_connector| must outlive 34 // the desktop process is changed. |desktop_session_connector| must outlive
29 // |this|. |client| specifies the client session owning |this|. 35 // |this|. |client| specifies the client session owning |this|.
30 IpcDesktopEnvironment( 36 IpcDesktopEnvironment(
31 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, 37 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner,
38 scoped_refptr<base::SingleThreadTaskRunner> network_task_runner,
32 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, 39 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner,
33 DesktopSessionConnector* desktop_session_connector, 40 DesktopSessionConnector* desktop_session_connector,
34 ClientSession* client); 41 ClientSession* client);
35 virtual ~IpcDesktopEnvironment(); 42 virtual ~IpcDesktopEnvironment();
36 43
44 // IPC::Listener implementation.
45 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
46 virtual void OnChannelConnected(int32 peer_pid) OVERRIDE;
47 virtual void OnChannelError() OVERRIDE;
48
37 virtual void Start( 49 virtual void Start(
38 scoped_ptr<protocol::ClipboardStub> client_clipboard) OVERRIDE; 50 scoped_ptr<protocol::ClipboardStub> client_clipboard) OVERRIDE;
39 51
40 // Disconnects the client session that owns |this|. 52 // Disconnects the client session that owns |this|.
41 void DisconnectClient(); 53 void DisconnectClient();
42 54
55 // Notifies |this| that it is now attached to a desktop integration process.
56 // |desktop_process| specifies the process handle. |desktop_pipe| is
57 // the client end of the pipe opened by the desktop process.
58 void OnDesktopSessionAgentAttached(
59 IPC::PlatformFileForTransit desktop_process,
60 IPC::PlatformFileForTransit desktop_pipe);
61
43 private: 62 private:
63 // Used for IPC I/O.
64 scoped_refptr<base::SingleThreadTaskRunner> network_task_runner_;
65
44 DesktopSessionConnector* desktop_session_connector_; 66 DesktopSessionConnector* desktop_session_connector_;
45 67
46 // Specifies the client session that owns |this|. 68 // Specifies the client session that owns |this|.
47 ClientSession* client_; 69 ClientSession* client_;
48 70
49 // True if |this| has been connected to a desktop session. 71 // True if |this| has been connected to a desktop session.
50 bool connected_; 72 bool connected_;
51 73
74 // Connects |this| with the desktop process.
75 scoped_ptr<IPC::ChannelProxy> desktop_channel_;
76
52 DISALLOW_COPY_AND_ASSIGN(IpcDesktopEnvironment); 77 DISALLOW_COPY_AND_ASSIGN(IpcDesktopEnvironment);
53 }; 78 };
54 79
55 } // namespace remoting 80 } // namespace remoting
56 81
57 #endif // REMOTING_HOST_IPC_DESKTOP_ENVIRONMENT_H_ 82 #endif // REMOTING_HOST_IPC_DESKTOP_ENVIRONMENT_H_
OLDNEW
« 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