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

Unified Diff: remoting/client/chromoting_client.h

Issue 384523003: Cleanups in ChromotingClient (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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/client/chromoting_client.h
diff --git a/remoting/client/chromoting_client.h b/remoting/client/chromoting_client.h
index 65f9910d052fb59585bb8a94a97d8e09e1012ea2..b052c9a0b6155751ecb038e1f959602bb82141c6 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);
};
« no previous file with comments | « remoting/android/java/src/org/chromium/chromoting/jni/JniInterface.java ('k') | remoting/client/chromoting_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698