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

Unified Diff: remoting/host/desktop_session_agent.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.cc ('k') | remoting/host/desktop_session_agent.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/desktop_session_agent.h
diff --git a/remoting/host/desktop_session_agent.h b/remoting/host/desktop_session_agent.h
new file mode 100644
index 0000000000000000000000000000000000000000..569dfd56bd74040e6f0e0013e7e72347efabdc8e
--- /dev/null
+++ b/remoting/host/desktop_session_agent.h
@@ -0,0 +1,84 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef REMOTING_HOST_DESKTOP_SESSION_AGENT_H_
+#define REMOTING_HOST_DESKTOP_SESSION_AGENT_H_
+
+#include "base/basictypes.h"
+#include "base/callback.h"
+#include "base/compiler_specific.h"
+#include "base/memory/ref_counted.h"
+#include "base/memory/scoped_ptr.h"
+#include "ipc/ipc_listener.h"
+#include "ipc/ipc_platform_file.h"
+
+namespace IPC {
+class ChannelProxy;
+class Message;
+} // namespace IPC
+
+namespace remoting {
+
+class AutoThreadTaskRunner;
+
+// Provides screen/audio capturing and input injection services for
+// the network process.
+class DesktopSessionAgent : public IPC::Listener {
+ public:
+ static scoped_ptr<DesktopSessionAgent> Create(
+ scoped_refptr<AutoThreadTaskRunner> caller_task_runner,
+ scoped_refptr<AutoThreadTaskRunner> io_task_runner);
+
+ virtual ~DesktopSessionAgent();
+
+ // IPC::Listener implementation.
+ virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
+ virtual void OnChannelConnected(int32 peer_pid) OVERRIDE;
+ virtual void OnChannelError() OVERRIDE;
+
+ // Creates the screen/audio recorders, input stubs and the IPC channel to be
+ // used to access them. Returns a handle of the client end of the IPC channel
+ // pipe to be forwarder to the corresponding desktop environment.
+ bool Start(const base::Closure& done_task,
+ IPC::PlatformFileForTransit* desktop_pipe_out);
+
+ protected:
+ DesktopSessionAgent(
+ scoped_refptr<AutoThreadTaskRunner> caller_task_runner,
+ scoped_refptr<AutoThreadTaskRunner> io_task_runner);
+
+ // Creates a pre-connected IPC channel to be used to access the screen/audio
+ // recorders and input stubs.
+ virtual bool DoCreateNetworkChannel(
+ IPC::PlatformFileForTransit* client_out,
+ scoped_ptr<IPC::ChannelProxy>* server_out) = 0;
+
+ scoped_refptr<AutoThreadTaskRunner> caller_task_runner() const {
+ return caller_task_runner_;
+ }
+
+ scoped_refptr<AutoThreadTaskRunner> io_task_runner() const {
+ return io_task_runner_;
+ }
+
+ private:
+ // Task runner on which public methods of this class should be called.
+ scoped_refptr<AutoThreadTaskRunner> caller_task_runner_;
+
+ // Message loop used by the IPC channel.
+ scoped_refptr<AutoThreadTaskRunner> io_task_runner_;
+
+ // Run on |caller_task_runner_| to notify the caller that |this| has been
+ // stopped.
+ base::Closure done_task_;
+
+ // IPC channel connecting the desktop process with the network process.
+ scoped_ptr<IPC::ChannelProxy> network_channel_;
+
+ DISALLOW_COPY_AND_ASSIGN(DesktopSessionAgent);
+};
+
+} // namespace remoting
+
+#endif // REMOTING_HOST_DESKTOP_SESSION_AGENT_H_
« no previous file with comments | « remoting/host/desktop_session.cc ('k') | remoting/host/desktop_session_agent.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698