summaryrefslogtreecommitdiffstats
path: root/remoting/host/client_session.h
diff options
context:
space:
mode:
authordcaiafa@chromium.org <dcaiafa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-30 20:13:15 +0000
committerdcaiafa@chromium.org <dcaiafa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-30 20:13:15 +0000
commit399b4f6b2fbef2e31cdda6a1ec7179d51006dafe (patch)
treecfa0f9f1394039bbb947fc668a190513b8ad0664 /remoting/host/client_session.h
parent034a1650ff98d0c1ecde107b1c73dbd8cd424bc1 (diff)
downloadchromium_src-399b4f6b2fbef2e31cdda6a1ec7179d51006dafe.zip
chromium_src-399b4f6b2fbef2e31cdda6a1ec7179d51006dafe.tar.gz
chromium_src-399b4f6b2fbef2e31cdda6a1ec7179d51006dafe.tar.bz2
Host extensions
This CL introduces HostExtension, an interface for classes that extend the host with non-core functionality. Extensions are added to the ChromotingHost. They are used to compile the list of capabilities reported to the client, which can be used by the client to determine the availability of the extension. When a client connects, a HostExtension has the opportunity to create an HostExtensionSession to hold client/extension state, and to handle extension messages from that client. BUG= NOTRY=true Review URL: https://codereview.chromium.org/301453003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@273901 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/host/client_session.h')
-rw-r--r--remoting/host/client_session.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/remoting/host/client_session.h b/remoting/host/client_session.h
index f892329..a86839e 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 OnSessionClientCapabilities(ClientSession* client) = 0;
+
// Called after authentication has failed. Must not tear down this
// object. OnSessionClosed() is notified after this handler
// returns.
@@ -103,6 +109,13 @@ 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 extended capabilities to advertise to the client, e.g. those
+ // implemented by |DesktopEnvironment| or |HostExtension|s.
+ void AddHostCapabilities(const std::string& capability);
+
// protocol::HostStub interface.
virtual void NotifyClientResolution(
const protocol::ClientResolution& resolution) OVERRIDE;
@@ -148,7 +161,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 +263,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);
};