summaryrefslogtreecommitdiffstats
path: root/remoting/host/desktop_environment.h
diff options
context:
space:
mode:
authorpeter@chromium.org <peter@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-12 15:11:15 +0000
committerpeter@chromium.org <peter@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-12 15:11:15 +0000
commite7c9260935017a441363101453705511ef49a5b7 (patch)
tree18da17357004e9db4e33a1abcc69f0a61c19eba1 /remoting/host/desktop_environment.h
parent238c4c6a04696a407c8c3868d956f8b6a531b52e (diff)
downloadchromium_src-e7c9260935017a441363101453705511ef49a5b7.zip
chromium_src-e7c9260935017a441363101453705511ef49a5b7.tar.gz
chromium_src-e7c9260935017a441363101453705511ef49a5b7.tar.bz2
Revert 156297 - [Chromoting] Refactoring DesktopEnvironment and moving screen/audio recorders to ClientSession.
This CL changes the way screen/audio recorders and event executors are managed. New DesktopEnvironmentFactory class is now used by ChromotingHost's owner to specify the kind of desktop environment (or virtual terminal) to be used by the host. Screen/audio recorders and event executors now owned by the ClientSession instance, so there is a separate set of recorders and stubs exists for each authenticated client session. Clients sessions can now be torn dowsn in parallel with the host shuttting down. This is the 3rd attempt to land this change. This version includes: - |ClientSession| objects are torn down asynchronously now. - |ClientSession| objects are ref-counted to facilitate the asynchronous shutdown. They still have to be used and destroyed on the network thread. - |ChromotingHost| now waits until all connections are torn down before deleting the session manager. - The unit tests were fixed to run message loops until all asynchronous object have been destroyed. BUG=134694 TEST=remoting_unittests Review URL: https://chromiumcodereview.appspot.com/10915206 TBR=alexeypa@chromium.org Review URL: https://chromiumcodereview.appspot.com/10911248 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@156298 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/host/desktop_environment.h')
-rw-r--r--remoting/host/desktop_environment.h43
1 files changed, 32 insertions, 11 deletions
diff --git a/remoting/host/desktop_environment.h b/remoting/host/desktop_environment.h
index a653c78e..8b32a89 100644
--- a/remoting/host/desktop_environment.h
+++ b/remoting/host/desktop_environment.h
@@ -5,6 +5,8 @@
#ifndef REMOTING_HOST_DESKTOP_ENVIRONMENT_H_
#define REMOTING_HOST_DESKTOP_ENVIRONMENT_H_
+#include <string>
+
#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
@@ -21,28 +23,47 @@ class ClipboardStub;
class DesktopEnvironment {
public:
- DesktopEnvironment(scoped_ptr<AudioCapturer> audio_capturer,
- scoped_ptr<EventExecutor> event_executor,
- scoped_ptr<VideoFrameCapturer> video_capturer);
+ // Creates a DesktopEnvironment used in a host plugin.
+ static scoped_ptr<DesktopEnvironment> Create(
+ ChromotingHostContext* context);
+
+ // Creates a DesktopEnvironment used in a service process.
+ static scoped_ptr<DesktopEnvironment> CreateForService(
+ ChromotingHostContext* context);
+
+ static scoped_ptr<DesktopEnvironment> CreateFake(
+ ChromotingHostContext* context,
+ scoped_ptr<VideoFrameCapturer> capturer,
+ scoped_ptr<EventExecutor> event_executor,
+ scoped_ptr<AudioCapturer> audio_capturer);
+
virtual ~DesktopEnvironment();
- AudioCapturer* audio_capturer() const { return audio_capturer_.get(); }
+ VideoFrameCapturer* capturer() const { return capturer_.get(); }
EventExecutor* event_executor() const { return event_executor_.get(); }
- VideoFrameCapturer* video_capturer() const { return video_capturer_.get(); }
-
- virtual void Start(
- scoped_ptr<protocol::ClipboardStub> client_clipboard);
+ AudioCapturer* audio_capturer() const { return audio_capturer_.get(); }
+ void OnSessionStarted(scoped_ptr<protocol::ClipboardStub> client_clipboard);
+ void OnSessionFinished();
private:
+ DesktopEnvironment(ChromotingHostContext* context,
+ scoped_ptr<VideoFrameCapturer> capturer,
+ scoped_ptr<EventExecutor> event_executor,
+ scoped_ptr<AudioCapturer> audio_capturer);
+
+ // Host context used to make sure operations are run on the correct thread.
+ // This is owned by the ChromotingHost.
+ ChromotingHostContext* context_;
+
+ // Used to capture video to deliver to clients.
+ scoped_ptr<VideoFrameCapturer> capturer_;
+
// Used to capture audio to deliver to clients.
scoped_ptr<AudioCapturer> audio_capturer_;
// Executes input and clipboard events received from the client.
scoped_ptr<EventExecutor> event_executor_;
- // Used to capture video to deliver to clients.
- scoped_ptr<VideoFrameCapturer> video_capturer_;
-
DISALLOW_COPY_AND_ASSIGN(DesktopEnvironment);
};