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

Unified Diff: remoting/client/chromoting_client.h

Issue 1520323007: Simplify ConnectionToHost interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@sm_cleanup
Patch Set: Created 5 years 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
« no previous file with comments | « no previous file | remoting/client/chromoting_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/client/chromoting_client.h
diff --git a/remoting/client/chromoting_client.h b/remoting/client/chromoting_client.h
index 93daab2150bf181e668c2dc118d31870c279872f..6c179f45008a8f8d826781c5f6dafb5d97c4b9db 100644
--- a/remoting/client/chromoting_client.h
+++ b/remoting/client/chromoting_client.h
@@ -18,6 +18,7 @@
#include "remoting/protocol/input_stub.h"
#include "remoting/protocol/performance_tracker.h"
#include "remoting/protocol/video_stub.h"
+#include "remoting/signaling/signal_strategy.h"
namespace base {
class SingleThreadTaskRunner;
@@ -37,9 +38,9 @@ class ClientUserInterface;
class FrameConsumerProxy;
class FrameProducer;
class VideoRenderer;
-class SignalStrategy;
-class ChromotingClient : public protocol::ConnectionToHost::HostEventCallback,
+class ChromotingClient : public SignalStrategy::Listener,
+ public protocol::ConnectionToHost::HostEventCallback,
public protocol::ClientStub {
public:
// |client_context|, |user_interface| and |video_renderer| must outlive the
@@ -52,7 +53,10 @@ class ChromotingClient : public protocol::ConnectionToHost::HostEventCallback,
~ChromotingClient() override;
- void set_protocol_config(scoped_ptr<protocol::CandidateSessionConfig> config);
+ void set_protocol_config(
+ scoped_ptr<protocol::CandidateSessionConfig> config) {
+ protocol_config_ = config.Pass();
+ }
// Used to set fake/mock objects for tests which use the ChromotingClient.
void SetConnectionToHostForTests(
@@ -96,17 +100,32 @@ class ChromotingClient : public protocol::ConnectionToHost::HostEventCallback,
const protocol::TransportRoute& route) override;
private:
+ // SignalStrategy::StatusObserver interface.
+ void OnSignalStrategyStateChange(SignalStrategy::State state) override;
+ bool OnSignalStrategyIncomingStanza(const buzz::XmlElement* stanza) override;
+
+ // Starts connection once |signal_strategy_| is connected.
+ void StartConnection();
+
// Called when the connection is authenticated.
void OnAuthenticated();
// Called when all channels are connected.
void OnChannelsConnected();
+ base::ThreadChecker thread_checker_;
+
+ scoped_ptr<protocol::CandidateSessionConfig> protocol_config_;
+
// The following are not owned by this class.
- scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
- ClientUserInterface* user_interface_;
- VideoRenderer* video_renderer_;
+ ClientUserInterface* user_interface_ = nullptr;
+ VideoRenderer* video_renderer_ = nullptr;
+ SignalStrategy* signal_strategy_ = nullptr;
+
+ std::string host_jid_;
+ scoped_ptr<protocol::Authenticator> authenticator_;
+ scoped_ptr<protocol::SessionManager> session_manager_;
scoped_ptr<protocol::ConnectionToHost> connection_;
scoped_ptr<AudioDecodeScheduler> audio_decode_scheduler_;
@@ -117,7 +136,7 @@ class ChromotingClient : public protocol::ConnectionToHost::HostEventCallback,
std::string host_capabilities_;
// True if |protocol::Capabilities| message has been received.
- bool host_capabilities_received_;
+ bool host_capabilities_received_ = false;
// Record the statistics of the connection.
protocol::PerformanceTracker perf_tracker_;
« no previous file with comments | « no previous file | remoting/client/chromoting_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698