diff options
author | alexeypa@chromium.org <alexeypa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-08 09:52:34 +0000 |
---|---|---|
committer | alexeypa@chromium.org <alexeypa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-08 09:52:34 +0000 |
commit | 4c35f73337302284aaa503dc2d6b2172623687b5 (patch) | |
tree | 35d32d1c06d8c8fd2b87ffbe0587d1509c5ac6eb /remoting/host/chromoting_host.h | |
parent | dd29cd42928c96b849ab5b832fbe78e1cd1cd9ef (diff) | |
download | chromium_src-4c35f73337302284aaa503dc2d6b2172623687b5.zip chromium_src-4c35f73337302284aaa503dc2d6b2172623687b5.tar.gz chromium_src-4c35f73337302284aaa503dc2d6b2172623687b5.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.
This is the 2nd attempt to land this change. This version includes:
- |ClientSession| objects are torn down asynchronously now.
- |ChromotingHost| now waits until all connections are torn down before deleting the session manager.
BUG=134694
TEST=remoting_unittests
Review URL: https://chromiumcodereview.appspot.com/10911152
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@155574 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/host/chromoting_host.h')
-rw-r--r-- | remoting/host/chromoting_host.h | 48 |
1 files changed, 14 insertions, 34 deletions
diff --git a/remoting/host/chromoting_host.h b/remoting/host/chromoting_host.h index 3cbf2b7..0d53e48 100644 --- a/remoting/host/chromoting_host.h +++ b/remoting/host/chromoting_host.h @@ -12,9 +12,7 @@ #include "base/observer_list.h" #include "base/threading/thread.h" #include "net/base/backoff_entry.h" -#include "remoting/codec/video_encoder.h" #include "remoting/host/client_session.h" -#include "remoting/host/desktop_environment.h" #include "remoting/host/host_key_pair.h" #include "remoting/host/host_status_observer.h" #include "remoting/host/mouse_move_observer.h" @@ -31,13 +29,8 @@ class SessionConfig; class CandidateSessionConfig; } // namespace protocol -class AudioEncoder; -class AudioScheduler; class ChromotingHostContext; -class DesktopEnvironment; -class Encoder; -class ScreenRecorder; -class VideoFrameCapturer; +class DesktopEnvironmentFactory; // A class to implement the functionality of a host process. // @@ -69,10 +62,11 @@ class ChromotingHost : public base::RefCountedThreadSafe<ChromotingHost>, public: // The caller must ensure that |context|, |signal_strategy| and // |environment| out-live the host. - ChromotingHost(ChromotingHostContext* context, - SignalStrategy* signal_strategy, - DesktopEnvironment* environment, - scoped_ptr<protocol::SessionManager> session_manager); + ChromotingHost( + ChromotingHostContext* context, + SignalStrategy* signal_strategy, + DesktopEnvironmentFactory* desktop_environment_factory, + scoped_ptr<protocol::SessionManager> session_manager); // Asynchronously start the host process. // @@ -163,21 +157,12 @@ class ChromotingHost : public base::RefCountedThreadSafe<ChromotingHost>, kStopped, }; - // Creates encoder for the specified configuration. - static VideoEncoder* CreateVideoEncoder( - const protocol::SessionConfig& config); - - // Creates an audio encoder for the specified configuration. - static scoped_ptr<AudioEncoder> CreateAudioEncoder( - const protocol::SessionConfig& config); - virtual ~ChromotingHost(); - void StopScreenRecorder(); - void StopAudioScheduler(); - void OnRecorderStopped(); + // Called when a client session is stopped completely. + void OnClientStopped(); - // Called from Shutdown() or OnScreenRecorderStopped() to finish shutdown. + // Called from Shutdown() to finish shutdown. void ShutdownFinish(); // Unless specified otherwise all members of this class must be @@ -185,7 +170,7 @@ class ChromotingHost : public base::RefCountedThreadSafe<ChromotingHost>, // Parameters specified when the host was created. ChromotingHostContext* context_; - DesktopEnvironment* desktop_environment_; + DesktopEnvironmentFactory* desktop_environment_factory_; scoped_ptr<protocol::SessionManager> session_manager_; // Connection objects. @@ -197,15 +182,10 @@ class ChromotingHost : public base::RefCountedThreadSafe<ChromotingHost>, // The connections to remote clients. ClientList clients_; - // Schedulers for audio and video capture. - // TODO(sergeyu): Do we need to have one set of schedulers per client? - scoped_refptr<ScreenRecorder> recorder_; - scoped_refptr<AudioScheduler> audio_scheduler_; - - // Number of screen recorders and audio schedulers that are currently being - // stopped. Used to delay shutdown if one or more recorders/schedulers are - // asynchronously shutting down. - int stopping_recorders_; + // The number of allocated |ClientSession| objects. |clients_count_| can be + // greater than |clients_.size()| because it also includes the objects that + // are about to be deleted. + int clients_count_; // Tracks the internal state of the host. State state_; |