diff options
author | alexeypa@chromium.org <alexeypa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-16 17:23:53 +0000 |
---|---|---|
committer | alexeypa@chromium.org <alexeypa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-16 17:23:53 +0000 |
commit | ce404cae8c35d9c39b328e2f7207b852f482a15f (patch) | |
tree | 99624ecd8daa98c28eb35323aa465ca8819fd480 /remoting/host/client_session.h | |
parent | e921967a10108d9751709ff4f35abd67b49103f8 (diff) | |
download | chromium_src-ce404cae8c35d9c39b328e2f7207b852f482a15f.zip chromium_src-ce404cae8c35d9c39b328e2f7207b852f482a15f.tar.gz chromium_src-ce404cae8c35d9c39b328e2f7207b852f482a15f.tar.bz2 |
Making DesktopEnvironment a factory class used by ClientSession to create audio/video capturers and event executor for a pacticular desktop environment.
Other related changes:
- AudioCapturer and VideoFrameCapturer are owned by AudioScheduler and VideoScheduler correspondingly.
- Both AudioScheduler and VideoScheduler can now be stopped completely asynchronously.
- AudioScheduler::SetEnabled() changed to Pause() to match the corresponding method provided by VideoScheduler.
- ClientSession::Stop() is synchronous now.
BUG=104544
Review URL: https://chromiumcodereview.appspot.com/11778049
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@177161 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/host/client_session.h')
-rw-r--r-- | remoting/host/client_session.h | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/remoting/host/client_session.h b/remoting/host/client_session.h index f61cb53..6d32adf 100644 --- a/remoting/host/client_session.h +++ b/remoting/host/client_session.h @@ -8,6 +8,7 @@ #include <list> #include "base/memory/ref_counted.h" +#include "base/memory/weak_ptr.h" #include "base/sequenced_task_runner_helpers.h" #include "base/time.h" #include "base/timer.h" @@ -36,8 +37,8 @@ class AudioScheduler; struct ClientSessionTraits; class DesktopEnvironment; class DesktopEnvironmentFactory; +class EventExecutor; class VideoEncoder; -class VideoFrameCapturer; class VideoScheduler; // A ClientSession keeps a reference to a connection to a client, and maintains @@ -91,9 +92,11 @@ class ClientSession ClientSession( EventHandler* event_handler, scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner, + scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, scoped_refptr<base::SingleThreadTaskRunner> video_capture_task_runner, scoped_refptr<base::SingleThreadTaskRunner> video_encode_task_runner, scoped_refptr<base::SingleThreadTaskRunner> network_task_runner, + scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, scoped_ptr<protocol::ConnectionToClient> connection, DesktopEnvironmentFactory* desktop_environment_factory, const base::TimeDelta& max_duration); @@ -125,9 +128,9 @@ class ClientSession // method returns. void Disconnect(); - // Stops the ClientSession, and calls |stopped_task| on |network_task_runner_| - // when fully stopped. - void Stop(const base::Closure& stopped_task); + // Stops the ClientSession. The caller can safely release its reference to + // the client session once Stop() returns. + void Stop(); protocol::ConnectionToClient* connection() const { return connection_.get(); @@ -154,8 +157,6 @@ class ClientSession // Creates a proxy for sending clipboard events to the client. scoped_ptr<protocol::ClipboardStub> CreateClipboardProxy(); - void OnRecorderStopped(); - // Creates an audio encoder for the specified configuration. static scoped_ptr<AudioEncoder> CreateAudioEncoder( const protocol::SessionConfig& config); @@ -172,11 +173,11 @@ class ClientSession // Used to disable callbacks to |connection_| once it is disconnected. base::WeakPtrFactory<protocol::ConnectionToClient> connection_factory_; + std::string client_jid_; + // The desktop environment used by this session. scoped_ptr<DesktopEnvironment> desktop_environment_; - std::string client_jid_; - // Filter used as the final element in the input pipeline. protocol::InputFilter host_input_filter_; @@ -216,21 +217,17 @@ class ClientSession base::OneShotTimer<ClientSession> max_duration_timer_; scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner_; + scoped_refptr<base::SingleThreadTaskRunner> input_task_runner_; scoped_refptr<base::SingleThreadTaskRunner> video_capture_task_runner_; scoped_refptr<base::SingleThreadTaskRunner> video_encode_task_runner_; scoped_refptr<base::SingleThreadTaskRunner> network_task_runner_; + scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_; // Schedulers for audio and video capture. scoped_refptr<AudioScheduler> audio_scheduler_; scoped_refptr<VideoScheduler> video_scheduler_; - // Number of screen recorders and audio schedulers that are currently being - // used or shutdown. Used to delay shutdown if one or more - // recorders/schedulers are asynchronously shutting down. - int active_recorders_; - - // Task to execute once the session is completely stopped. - base::Closure stopped_task_; + scoped_ptr<EventExecutor> event_executor_; DISALLOW_COPY_AND_ASSIGN(ClientSession); }; |