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

Unified Diff: remoting/host/client_session.h

Issue 301453003: Host extensions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ChromotingHost creates extension sessions, and adds capabilities Created 6 years, 7 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 f8923297df77816725a250ab44a445eb4edae483..70fd887ea64a07ec28f9481f63bf28fff2db8fe5 100644
--- a/remoting/host/client_session.h
+++ b/remoting/host/client_session.h
@@ -8,6 +8,7 @@
#include <string>
#include "base/memory/ref_counted.h"
+#include "base/memory/scoped_vector.h"
#include "base/memory/weak_ptr.h"
#include "base/sequenced_task_runner_helpers.h"
#include "base/threading/non_thread_safe.h"
@@ -15,6 +16,8 @@
#include "base/timer/timer.h"
#include "remoting/host/client_session_control.h"
#include "remoting/host/gnubby_auth_handler.h"
+#include "remoting/host/host_extension.h"
+#include "remoting/host/host_extension_session.h"
#include "remoting/host/mouse_clamping_filter.h"
#include "remoting/host/remote_input_filter.h"
#include "remoting/protocol/clipboard_echo_filter.h"
@@ -64,6 +67,9 @@ class ClientSession
// Called after we've finished connecting all channels.
virtual void OnSessionChannelsConnected(ClientSession* client) = 0;
+ // Called after client has reported capabilities.
+ virtual void OnClientCapabilities(ClientSession* client) = 0;
Wez 2014/05/28 23:03:41 All the other handlers are OnSession<Foo>; OnSessi
dcaiafa 2014/05/29 00:03:16 Done.
+
// Called after authentication has failed. Must not tear down this
// object. OnSessionClosed() is notified after this handler
// returns.
@@ -88,7 +94,7 @@ class ClientSession
virtual ~EventHandler() {}
};
- // |event_handler| and |desktop_environment_factory| must outlive |this|.
+ // |event_handler|, |desktop_environment_factory| must outlive |this|.
Wez 2014/05/28 23:03:41 nit: , -> and
dcaiafa 2014/05/29 00:03:16 Done.
ClientSession(
EventHandler* event_handler,
scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner,
@@ -103,6 +109,14 @@ class ClientSession
scoped_refptr<protocol::PairingRegistry> pairing_registry);
virtual ~ClientSession();
+ // Adds an extension to client to handle extension messages.
+ void AddExtensionSession(scoped_ptr<HostExtensionSession> extension_session);
+
+ // Adds one or more host capabilities in the form of a space-separated list of
+ // words, to be reported to the client.
+ // This must be called during the call to |OnSessionAuthenticated|.
+ void AddHostCapabilities(const std::string& capability);
+
// protocol::HostStub interface.
virtual void NotifyClientResolution(
const protocol::ClientResolution& resolution) OVERRIDE;
@@ -148,7 +162,13 @@ class ClientSession
bool is_authenticated() { return auth_input_filter_.enabled(); }
+ const std::string* client_capabilities() const {
+ return client_capabilities_.get();
+ }
+
private:
+ typedef ScopedVector<HostExtensionSession> HostExtensionSessionList;
+
// Creates a proxy for sending clipboard events to the client.
scoped_ptr<protocol::ClipboardStub> CreateClipboardProxy();
@@ -244,6 +264,9 @@ class ClientSession
// Used to proxy gnubby auth traffic.
scoped_ptr<GnubbyAuthHandler> gnubby_auth_handler_;
+ // Host extension sessions, used to handle extension messages.
+ HostExtensionSessionList extension_sessions_;
+
DISALLOW_COPY_AND_ASSIGN(ClientSession);
};

Powered by Google App Engine
This is Rietveld 408576698