summaryrefslogtreecommitdiffstats
path: root/remoting/client/chromoting_client.h
diff options
context:
space:
mode:
authorsergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-12 00:46:52 +0000
committersergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-12 00:46:52 +0000
commitfb0d52fa9455c6eb25c14750760397741ab87835 (patch)
tree22d0cc6955cc488b3b256ac91fe21d311d2a0e5f /remoting/client/chromoting_client.h
parent573e6cc843e5f9e7ee6a777e030ace25befd64cc (diff)
downloadchromium_src-fb0d52fa9455c6eb25c14750760397741ab87835.zip
chromium_src-fb0d52fa9455c6eb25c14750760397741ab87835.tar.gz
chromium_src-fb0d52fa9455c6eb25c14750760397741ab87835.tar.bz2
Cleanups in ChromotingClient
1. Moved creation of ConnectionToHost to ChromotingClient. Previously ConnectionToHost had to be passed in the constructor. 2. Authentication now is created outside of ChromotingClient. This allowed to remove ClientConfig struct (it was used mostly to pass authentication parameters). This will also allow passing a fake authenticator for tests. 3. Removed ClientConfig. Review URL: https://codereview.chromium.org/384523003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@282757 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/client/chromoting_client.h')
-rw-r--r--remoting/client/chromoting_client.h32
1 files changed, 18 insertions, 14 deletions
diff --git a/remoting/client/chromoting_client.h b/remoting/client/chromoting_client.h
index 65f9910..b052c9a 100644
--- a/remoting/client/chromoting_client.h
+++ b/remoting/client/chromoting_client.h
@@ -11,8 +11,6 @@
#include "base/callback.h"
#include "base/memory/scoped_ptr.h"
-#include "base/memory/weak_ptr.h"
-#include "remoting/client/client_config.h"
#include "remoting/client/chromoting_stats.h"
#include "remoting/protocol/client_stub.h"
#include "remoting/protocol/clipboard_stub.h"
@@ -43,9 +41,7 @@ class ChromotingClient : public protocol::ConnectionToHost::HostEventCallback,
public protocol::ClientStub {
public:
// |audio_player| may be null, in which case audio will not be requested.
- ChromotingClient(const ClientConfig& config,
- ClientContext* client_context,
- protocol::ConnectionToHost* connection,
+ ChromotingClient(ClientContext* client_context,
ClientUserInterface* user_interface,
VideoRenderer* video_renderer,
scoped_ptr<AudioPlayer> audio_player);
@@ -55,7 +51,20 @@ class ChromotingClient : public protocol::ConnectionToHost::HostEventCallback,
// Start the client. Must be called on the main thread. |signal_strategy|
// must outlive the client.
void Start(SignalStrategy* signal_strategy,
- scoped_ptr<protocol::TransportFactory> transport_factory);
+ scoped_ptr<protocol::Authenticator> authenticator,
+ scoped_ptr<protocol::TransportFactory> transport_factory,
+ const std::string& host_jid,
+ const std::string& capabilities);
+
+ protocol::ConnectionToHost::State connection_state() const {
+ return connection_.state();
+ }
+
+ protocol::ClipboardStub* clipboard_forwarder() {
+ return connection_.clipboard_forwarder();
+ }
+ protocol::HostStub* host_stub() { return connection_.host_stub(); }
+ protocol::InputStub* input_stub() { return connection_.input_stub(); }
// ClientStub implementation.
virtual void SetCapabilities(
@@ -89,16 +98,15 @@ class ChromotingClient : public protocol::ConnectionToHost::HostEventCallback,
void OnChannelsConnected();
// The following are not owned by this class.
- ClientConfig config_;
scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
- protocol::ConnectionToHost* connection_;
ClientUserInterface* user_interface_;
VideoRenderer* video_renderer_;
+ protocol::ConnectionToHost connection_;
+
scoped_ptr<AudioDecodeScheduler> audio_decode_scheduler_;
- // If non-NULL, this is called when the client is done.
- base::Closure client_done_;
+ std::string local_capabilities_;
// The set of all capabilities supported by the host.
std::string host_capabilities_;
@@ -109,10 +117,6 @@ class ChromotingClient : public protocol::ConnectionToHost::HostEventCallback,
// Record the statistics of the connection.
ChromotingStats stats_;
- // WeakPtr used to avoid tasks accessing the client after it is deleted.
- base::WeakPtr<ChromotingClient> weak_ptr_;
- base::WeakPtrFactory<ChromotingClient> weak_factory_;
-
DISALLOW_COPY_AND_ASSIGN(ChromotingClient);
};