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

Unified Diff: remoting/protocol/session_config.cc

Issue 10834446: Improve handling of NONE transport in channel configuration. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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/session_config.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/session_config.cc
diff --git a/remoting/protocol/session_config.cc b/remoting/protocol/session_config.cc
index f3b2e038ec3fd1c24932265a37b8dda68a006741..6113552e4cb12ca4851b65fe032fe23b53e6a0c3 100644
--- a/remoting/protocol/session_config.cc
+++ b/remoting/protocol/session_config.cc
@@ -11,8 +11,10 @@ namespace protocol {
const int kDefaultStreamVersion = 2;
-ChannelConfig::ChannelConfig() {
- Reset();
+ChannelConfig::ChannelConfig()
+ : transport(TRANSPORT_NONE),
+ version(0),
+ codec(CODEC_UNDEFINED) {
}
ChannelConfig::ChannelConfig(TransportType transport, int version, Codec codec)
@@ -22,15 +24,12 @@ ChannelConfig::ChannelConfig(TransportType transport, int version, Codec codec)
}
bool ChannelConfig::operator==(const ChannelConfig& b) const {
+ // If the transport field is set to NONE then all other fields are irrelevant.
+ if (transport == ChannelConfig::TRANSPORT_NONE)
+ return transport == b.transport;
return transport == b.transport && version == b.version && codec == b.codec;
}
-void ChannelConfig::Reset() {
- transport = TRANSPORT_STREAM;
- version = kDefaultStreamVersion;
- codec = CODEC_UNDEFINED;
-}
-
SessionConfig::SessionConfig() {
}
@@ -205,10 +204,7 @@ scoped_ptr<CandidateSessionConfig> CandidateSessionConfig::CreateDefault() {
kDefaultStreamVersion,
ChannelConfig::CODEC_VERBATIM));
#endif // defined(ENABLE_REMOTING_AUDIO)
- result->mutable_audio_configs()->push_back(
- ChannelConfig(ChannelConfig::TRANSPORT_NONE,
- kDefaultStreamVersion,
- ChannelConfig::CODEC_VERBATIM));
+ result->mutable_audio_configs()->push_back(ChannelConfig());
return result.Pass();
}
« no previous file with comments | « remoting/protocol/session_config.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698