Skip to content

Commit

Permalink
Revert 273652 "Host extensions"
Browse files Browse the repository at this point in the history
gyp failure on Win:

Exception: Missing input files:

C:\b\build\slave\Win\build\src\remoting\host\extension.h

C:\b\build\slave\Win\build\src\remoting\host\extension_session.h


> 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=
> 
> Review URL: https://codereview.chromium.org/301453003

TBR=dcaiafa@chromium.org

Review URL: https://codereview.chromium.org/308743006

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@273674 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
mattm@chromium.org committed May 30, 2014
1 parent 766aef3 commit 057cf3c
Show file tree
Hide file tree
Showing 10 changed files with 4 additions and 365 deletions.
24 changes: 0 additions & 24 deletions remoting/host/chromoting_host.cc
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,6 @@ void ChromotingHost::RemoveStatusObserver(HostStatusObserver* observer) {
status_observers_.RemoveObserver(observer);
}

void ChromotingHost::AddExtension(scoped_ptr<HostExtension> extension) {
extensions_.push_back(extension.release());
}

void ChromotingHost::RejectAuthenticatingClient() {
DCHECK(authenticating_client_);
reject_authenticating_client_ = true;
Expand Down Expand Up @@ -234,19 +230,6 @@ void ChromotingHost::OnSessionChannelsConnected(ClientSession* client) {
OnClientConnected(client->client_jid()));
}

void ChromotingHost::OnSessionClientCapabilities(ClientSession* client) {
DCHECK(CalledOnValidThread());

// Create extension sessions from each registered extension for this client.
for (HostExtensionList::iterator extension = extensions_.begin();
extension != extensions_.end(); ++extension) {
scoped_ptr<HostExtensionSession> extension_session =
(*extension)->CreateExtensionSession(client);
if (extension_session)
client->AddExtensionSession(extension_session.Pass());
}
}

void ChromotingHost::OnSessionAuthenticationFailed(ClientSession* client) {
DCHECK(CalledOnValidThread());

Expand Down Expand Up @@ -337,13 +320,6 @@ void ChromotingHost::OnIncomingSession(
desktop_environment_factory_,
max_session_duration_,
pairing_registry_);

// Registers capabilities provided by host extensions.
for (HostExtensionList::iterator extension = extensions_.begin();
extension != extensions_.end(); ++extension) {
client->AddHostCapabilities((*extension)->GetCapabilities());
}

clients_.push_back(client);
}

Expand Down
12 changes: 1 addition & 11 deletions remoting/host/chromoting_host.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,14 @@
#include <list>
#include <string>

#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/scoped_vector.h"
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
#include "base/observer_list.h"
#include "base/threading/non_thread_safe.h"
#include "base/threading/thread.h"
#include "net/base/backoff_entry.h"
#include "remoting/host/client_session.h"
#include "remoting/host/host_extension.h"
#include "remoting/host/host_status_monitor.h"
#include "remoting/host/host_status_observer.h"
#include "remoting/protocol/authenticator.h"
Expand Down Expand Up @@ -93,9 +91,6 @@ class ChromotingHost : public base::NonThreadSafe,
virtual void AddStatusObserver(HostStatusObserver* observer) OVERRIDE;
virtual void RemoveStatusObserver(HostStatusObserver* observer) OVERRIDE;

// Registers a host extension.
void AddExtension(scoped_ptr<HostExtension> extension);

// This method may be called only from
// HostStatusObserver::OnClientAuthenticated() to reject the new
// client.
Expand Down Expand Up @@ -123,7 +118,6 @@ class ChromotingHost : public base::NonThreadSafe,
virtual void OnSessionAuthenticating(ClientSession* client) OVERRIDE;
virtual bool OnSessionAuthenticated(ClientSession* client) OVERRIDE;
virtual void OnSessionChannelsConnected(ClientSession* client) OVERRIDE;
virtual void OnSessionClientCapabilities(ClientSession* client) OVERRIDE;
virtual void OnSessionAuthenticationFailed(ClientSession* client) OVERRIDE;
virtual void OnSessionClosed(ClientSession* session) OVERRIDE;
virtual void OnSessionSequenceNumber(ClientSession* session,
Expand Down Expand Up @@ -160,7 +154,6 @@ class ChromotingHost : public base::NonThreadSafe,
friend class ChromotingHostTest;

typedef std::list<ClientSession*> ClientList;
typedef ScopedVector<HostExtension> HostExtensionList;

// Immediately disconnects all active clients. Host-internal components may
// shutdown asynchronously, but the caller is guaranteed not to receive
Expand Down Expand Up @@ -211,9 +204,6 @@ class ChromotingHost : public base::NonThreadSafe,
// The pairing registry for PIN-less authentication.
scoped_refptr<protocol::PairingRegistry> pairing_registry_;

// List of host extensions.
HostExtensionList extensions_;

base::WeakPtrFactory<ChromotingHost> weak_factory_;

DISALLOW_COPY_AND_ASSIGN(ChromotingHost);
Expand Down
32 changes: 1 addition & 31 deletions remoting/host/client_session.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include "remoting/host/audio_capturer.h"
#include "remoting/host/audio_scheduler.h"
#include "remoting/host/desktop_environment.h"
#include "remoting/host/host_extension_session.h"
#include "remoting/host/input_injector.h"
#include "remoting/host/screen_controls.h"
#include "remoting/host/screen_resolution.h"
Expand Down Expand Up @@ -99,25 +98,6 @@ ClientSession::~ClientSession() {
connection_.reset();
}

void ClientSession::AddExtensionSession(
scoped_ptr<HostExtensionSession> extension_session) {
DCHECK(CalledOnValidThread());

extension_sessions_.push_back(extension_session.release());
}

void ClientSession::AddHostCapabilities(const std::string& capabilities) {
DCHECK(CalledOnValidThread());

if (capabilities.empty())
return;

if (!host_capabilities_.empty())
host_capabilities_.append(" ");

host_capabilities_.append(capabilities);
}

void ClientSession::NotifyClientResolution(
const protocol::ClientResolution& resolution) {
DCHECK(CalledOnValidThread());
Expand Down Expand Up @@ -188,7 +168,6 @@ void ClientSession::SetCapabilities(
*client_capabilities_ = capabilities.capabilities();

VLOG(1) << "Client capabilities: " << *client_capabilities_;
event_handler_->OnSessionClientCapabilities(this);

// Calculate the set of capabilities enabled by both client and host and
// pass it to the desktop environment if it is available.
Expand Down Expand Up @@ -225,13 +204,6 @@ void ClientSession::DeliverClientMessage(
HOST_LOG << "gnubby auth is not enabled";
}
return;
} else {
for(HostExtensionSessionList::iterator it = extension_sessions_.begin();
it != extension_sessions_.end(); ++it) {
// Extension returns |true| to indicate that the message was handled.
if ((*it)->OnExtensionMessage(this, message))
return;
}
}
}
HOST_LOG << "Unexpected message received: "
Expand Down Expand Up @@ -281,16 +253,14 @@ void ClientSession::OnConnectionAuthenticated(
return;
}

AddHostCapabilities(desktop_environment_->GetCapabilities());
host_capabilities_ = desktop_environment_->GetCapabilities();

// Ignore protocol::Capabilities messages from the client if it does not
// support any capabilities.
if (!connection_->session()->config().SupportsCapabilities()) {
VLOG(1) << "The client does not support any capabilities.";

client_capabilities_ = make_scoped_ptr(new std::string());
event_handler_->OnSessionClientCapabilities(this);

desktop_environment_->SetCapabilities(*client_capabilities_);
}

Expand Down
22 changes: 0 additions & 22 deletions remoting/host/client_session.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,13 @@
#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"
#include "base/time/time.h"
#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"
Expand Down Expand Up @@ -67,9 +64,6 @@ 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.
Expand Down Expand Up @@ -109,13 +103,6 @@ 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;
Expand Down Expand Up @@ -161,13 +148,7 @@ 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();

Expand Down Expand Up @@ -263,9 +244,6 @@ 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);
};

Expand Down
Loading

0 comments on commit 057cf3c

Please sign in to comment.