summaryrefslogtreecommitdiffstats
path: root/remoting/host/desktop_environment.h
diff options
context:
space:
mode:
authoralexeypa@chromium.org <alexeypa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-06 18:30:17 +0000
committeralexeypa@chromium.org <alexeypa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-06 18:30:17 +0000
commitbc4eefa946cdab10c17114b0a0d15962f19e27a5 (patch)
tree7ea07f81e9bc76ec234938ec2a5b529e4c539b5a /remoting/host/desktop_environment.h
parentb669fd10946e4330e9f6913e0260a229d7461f60 (diff)
downloadchromium_src-bc4eefa946cdab10c17114b0a0d15962f19e27a5.zip
chromium_src-bc4eefa946cdab10c17114b0a0d15962f19e27a5.tar.gz
chromium_src-bc4eefa946cdab10c17114b0a0d15962f19e27a5.tar.bz2
[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. BUG=134694 TEST=remoting_unittests Review URL: https://chromiumcodereview.appspot.com/10920019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@155219 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/host/desktop_environment.h')
-rw-r--r--remoting/host/desktop_environment.h43
1 files changed, 11 insertions, 32 deletions
diff --git a/remoting/host/desktop_environment.h b/remoting/host/desktop_environment.h
index 8b32a89..a653c78e 100644
--- a/remoting/host/desktop_environment.h
+++ b/remoting/host/desktop_environment.h
@@ -5,8 +5,6 @@
#ifndef REMOTING_HOST_DESKTOP_ENVIRONMENT_H_
#define REMOTING_HOST_DESKTOP_ENVIRONMENT_H_
-#include <string>
-
#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
@@ -23,47 +21,28 @@ class ClipboardStub;
class DesktopEnvironment {
public:
- // 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);
-
+ DesktopEnvironment(scoped_ptr<AudioCapturer> audio_capturer,
+ scoped_ptr<EventExecutor> event_executor,
+ scoped_ptr<VideoFrameCapturer> video_capturer);
virtual ~DesktopEnvironment();
- VideoFrameCapturer* capturer() const { return capturer_.get(); }
- EventExecutor* event_executor() const { return event_executor_.get(); }
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_;
+ EventExecutor* event_executor() const { return event_executor_.get(); }
+ VideoFrameCapturer* video_capturer() const { return video_capturer_.get(); }
- // Used to capture video to deliver to clients.
- scoped_ptr<VideoFrameCapturer> capturer_;
+ virtual void Start(
+ scoped_ptr<protocol::ClipboardStub> client_clipboard);
+ private:
// 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);
};