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

Unified Diff: remoting/client/chromoting_client.cc

Issue 976233003: Adding the base ChromotingInstance implementation and unittests. This class will be used by the ap… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing a unit test name Created 5 years, 9 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.cc
diff --git a/remoting/client/chromoting_client.cc b/remoting/client/chromoting_client.cc
index 1ad7223f719f95c8096e2e23a46741e684f1d6ce..f250c82e714381864e67e09afeca1083a6e56645 100644
--- a/remoting/client/chromoting_client.cc
+++ b/remoting/client/chromoting_client.cc
@@ -33,6 +33,7 @@ ChromotingClient::ChromotingClient(
user_interface_(user_interface),
video_renderer_(video_renderer),
host_capabilities_received_(false) {
+ connection_.reset(new protocol::ConnectionToHost());
Sergey Ulanov 2015/03/09 06:44:40 this should be in the initializer list above, but
joedow 2015/03/09 21:09:25 The problem with moving this code to start is that
if (audio_player) {
audio_decode_scheduler_.reset(new AudioDecodeScheduler(
client_context->main_task_runner(),
@@ -45,7 +46,12 @@ ChromotingClient::~ChromotingClient() {}
void ChromotingClient::SetProtocolConfigForTests(
scoped_ptr<protocol::CandidateSessionConfig> config) {
- connection_.set_candidate_config(config.Pass());
+ connection_->set_candidate_config(config.Pass());
+}
+
+void ChromotingClient::SetConnectionToHostForTests(
+ scoped_ptr<protocol::ConnectionToHost> connection_to_host) {
+ connection_ = connection_to_host.Pass();
}
void ChromotingClient::Start(
@@ -58,12 +64,12 @@ void ChromotingClient::Start(
local_capabilities_ = capabilities;
- connection_.set_client_stub(this);
- connection_.set_clipboard_stub(this);
- connection_.set_video_stub(video_renderer_->GetVideoStub());
- connection_.set_audio_stub(audio_decode_scheduler_.get());
+ connection_->set_client_stub(this);
+ connection_->set_clipboard_stub(this);
+ connection_->set_video_stub(video_renderer_->GetVideoStub());
+ connection_->set_audio_stub(audio_decode_scheduler_.get());
- connection_.Connect(signal_strategy, transport_factory.Pass(),
+ connection_->Connect(signal_strategy, transport_factory.Pass(),
authenticator.Pass(), host_jid, this);
}
@@ -147,10 +153,9 @@ void ChromotingClient::OnAuthenticated() {
DCHECK(task_runner_->BelongsToCurrentThread());
// Initialize the decoder.
- video_renderer_->OnSessionConfig(connection_.config());
- if (connection_.config().is_audio_enabled())
- audio_decode_scheduler_->Initialize(connection_.config());
-
+ video_renderer_->OnSessionConfig(connection_->config());
+ if (connection_->config().is_audio_enabled())
+ audio_decode_scheduler_->Initialize(connection_->config());
}
void ChromotingClient::OnChannelsConnected() {
@@ -161,7 +166,7 @@ void ChromotingClient::OnChannelsConnected() {
protocol::Capabilities capabilities;
capabilities.set_capabilities(local_capabilities_);
- connection_.host_stub()->SetCapabilities(capabilities);
+ connection_->host_stub()->SetCapabilities(capabilities);
}
} // namespace remoting

Powered by Google App Engine
This is Rietveld 408576698