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

Unified Diff: remoting/host/client_session.h

Issue 10920019: [Chromoting] Refactoring DesktopEnvironment and moving screen/audio recorders to ClientSession. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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
Index: remoting/host/client_session.h
diff --git a/remoting/host/client_session.h b/remoting/host/client_session.h
index 0dd65d4855ae57279622ea5d3f62011b8dab504b..5a13cceb6b6f23411551a61e30b6d1d3b017d624 100644
--- a/remoting/host/client_session.h
+++ b/remoting/host/client_session.h
@@ -22,8 +22,17 @@
#include "remoting/protocol/mouse_input_filter.h"
#include "third_party/skia/include/core/SkPoint.h"
+namespace base {
+class SingleThreadTaskRunner;
+} // namespace base
+
namespace remoting {
+class AudioEncoder;
+class AudioScheduler;
+class DesktopEnvironment;
+class Encoder;
+class ScreenRecorder;
class VideoFrameCapturer;
// A ClientSession keeps a reference to a connection to a client, and maintains
@@ -67,10 +76,11 @@ class ClientSession : public protocol::HostStub,
};
ClientSession(EventHandler* event_handler,
+ scoped_refptr<base::SingleThreadTaskRunner> capture_task_runner,
+ scoped_refptr<base::SingleThreadTaskRunner> encode_task_runner,
+ scoped_refptr<base::SingleThreadTaskRunner> network_task_runner,
Wez 2012/08/31 18:18:02 Pass the ChromotingHostContext in here, so that Cl
alexeypa (please no reviews) 2012/08/31 23:13:30 I didn't want to pass ChromotingHostContext becaus
Wez 2012/09/06 00:13:22 OK. :)
scoped_ptr<protocol::ConnectionToClient> connection,
- protocol::ClipboardStub* host_clipboard_stub,
- protocol::InputStub* host_input_stub,
- VideoFrameCapturer* capturer,
+ scoped_ptr<DesktopEnvironment> desktop_environment,
const base::TimeDelta& max_duration);
virtual ~ClientSession();
@@ -104,10 +114,16 @@ class ClientSession : public protocol::HostStub,
// this method returns.
void Disconnect();
+ void StopAndDelete();
simonmorris 2012/09/04 18:47:21 Add a comment explaining what this does?
alexeypa (please no reviews) 2012/09/05 22:53:29 Done.
+
protocol::ConnectionToClient* connection() const {
return connection_.get();
}
+ DesktopEnvironment* desktop_environment() const {
+ return desktop_environment_.get();
+ }
+
const std::string& client_jid() { return client_jid_; }
bool is_authenticated() { return is_authenticated_; }
@@ -125,11 +141,25 @@ class ClientSession : public protocol::HostStub,
scoped_ptr<protocol::ClipboardStub> CreateClipboardProxy();
private:
+ // Creates encoder for the specified configuration.
+ static Encoder* CreateEncoder(const protocol::SessionConfig& config);
+
+ // Creates an audio encoder for the specified configuration.
+ static scoped_ptr<AudioEncoder> CreateAudioEncoder(
+ const protocol::SessionConfig& config);
+
+ void OnRecorderStopped();
+ void StopAudioScheduler();
+ void StopScreenRecorder();
+
EventHandler* event_handler_;
// The connection to the client.
scoped_ptr<protocol::ConnectionToClient> connection_;
+ // The desktop environment used by this session.
+ scoped_ptr<DesktopEnvironment> desktop_environment_;
+
std::string client_jid_;
bool is_authenticated_;
@@ -179,6 +209,19 @@ class ClientSession : public protocol::HostStub,
// is reached.
base::OneShotTimer<ClientSession> max_duration_timer_;
+ scoped_refptr<base::SingleThreadTaskRunner> capture_task_runner_;
+ scoped_refptr<base::SingleThreadTaskRunner> encode_task_runner_;
+ scoped_refptr<base::SingleThreadTaskRunner> network_task_runner_;
+
+ // Schedulers for audio and video capture.
+ scoped_refptr<AudioScheduler> audio_scheduler_;
+ scoped_refptr<ScreenRecorder> video_recorder_;
+
+ // 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_;
+
DISALLOW_COPY_AND_ASSIGN(ClientSession);
};

Powered by Google App Engine
This is Rietveld 408576698