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

Unified Diff: remoting/protocol/connection_to_host.cc

Issue 394883008: Add basic perf tests for chromoting protocol. (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
« no previous file with comments | « remoting/protocol/connection_to_host.h ('k') | remoting/remoting_test.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/connection_to_host.cc
diff --git a/remoting/protocol/connection_to_host.cc b/remoting/protocol/connection_to_host.cc
index 86ab5443ffa1992fd0fee89a0eaba64597275b88..71c7764fd383d7a859385ced6c1e5ce5662e4000 100644
--- a/remoting/protocol/connection_to_host.cc
+++ b/remoting/protocol/connection_to_host.cc
@@ -57,6 +57,16 @@ void ConnectionToHost::Connect(SignalStrategy* signal_strategy,
DCHECK(clipboard_stub_);
DCHECK(monitored_video_stub_);
+ // Initialize default |candidate_config_| if set_candidate_config() wasn't
+ // called.
+ if (!candidate_config_) {
+ candidate_config_ = CandidateSessionConfig::CreateDefault();
+ if (!audio_stub_) {
+ candidate_config_->DisableAudioChannel();
+ }
+ candidate_config_->EnableVideoCodec(ChannelConfig::CODEC_VP9);
+ }
+
signal_strategy_ = signal_strategy;
event_callback_ = event_callback;
authenticator_ = authenticator.Pass();
@@ -74,6 +84,14 @@ void ConnectionToHost::Connect(SignalStrategy* signal_strategy,
SetState(CONNECTING, OK);
}
+void ConnectionToHost::set_candidate_config(
+ scoped_ptr<CandidateSessionConfig> config) {
+ DCHECK_EQ(state_, INITIALIZING);
+
+ candidate_config_ = config.Pass();
+}
+
+
const SessionConfig& ConnectionToHost::config() {
return session_->config();
}
@@ -135,15 +153,8 @@ void ConnectionToHost::OnSessionManagerReady() {
DCHECK(CalledOnValidThread());
// After SessionManager is initialized we can try to connect to the host.
- scoped_ptr<CandidateSessionConfig> candidate_config =
- CandidateSessionConfig::CreateDefault();
- if (!audio_stub_) {
- candidate_config->DisableAudioChannel();
- }
- candidate_config->EnableVideoCodec(ChannelConfig::CODEC_VP9);
-
session_ = session_manager_->Connect(
- host_jid_, authenticator_.Pass(), candidate_config.Pass());
+ host_jid_, authenticator_.Pass(), candidate_config_.Pass());
session_->SetEventHandler(this);
}
« no previous file with comments | « remoting/protocol/connection_to_host.h ('k') | remoting/remoting_test.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698