From d00be8da1524cd3694ea2b6053ef2899bbca3616 Mon Sep 17 00:00:00 2001 From: "sergeyu@chromium.org" Date: Sun, 5 May 2013 03:15:11 +0000 Subject: Cleanup code that format session description. Session description message contains version and codec even for disabled channels. That's no longer necessary because all current hosts should ignore these attributes for disabled channels. BUG=144053 Review URL: https://chromiumcodereview.appspot.com/14624009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@198339 0039d316-1c4b-4281-b951-d872f2087c98 --- remoting/protocol/content_description.cc | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) (limited to 'remoting/protocol') diff --git a/remoting/protocol/content_description.cc b/remoting/protocol/content_description.cc index 1ea74ee..65385f9 100644 --- a/remoting/protocol/content_description.cc +++ b/remoting/protocol/content_description.cc @@ -63,18 +63,14 @@ XmlElement* FormatChannelConfig(const ChannelConfig& config, result->AddAttr(QName(kDefaultNs, kTransportAttr), ValueToName(kTransports, config.transport)); - // TODO(sergeyu): Here we add version and codec attributes even when transport - // is set to NONE. This is needed for backward compatibility only. Fix this - // code once the current stable version is able to cope with missing version - // and codec attributes. - // crbug.com/144053 - - result->AddAttr(QName(kDefaultNs, kVersionAttr), - base::IntToString(config.version)); - - if (config.codec != ChannelConfig::CODEC_UNDEFINED) { - result->AddAttr(QName(kDefaultNs, kCodecAttr), - ValueToName(kCodecs, config.codec)); + if (config.transport != ChannelConfig::TRANSPORT_NONE) { + result->AddAttr(QName(kDefaultNs, kVersionAttr), + base::IntToString(config.version)); + + if (config.codec != ChannelConfig::CODEC_UNDEFINED) { + result->AddAttr(QName(kDefaultNs, kCodecAttr), + ValueToName(kCodecs, config.codec)); + } } return result; @@ -168,14 +164,6 @@ XmlElement* ContentDescription::ToXml() const { for (it = config()->audio_configs().begin(); it != config()->audio_configs().end(); ++it) { ChannelConfig config = *it; - if (config.transport == ChannelConfig::TRANSPORT_NONE) { - // Older client and host may expect the following values for for the - // version and codec for the NONE audio config. - // TODO(sergeyu): Remove this code once the current version supports. - // crbug.com/144053 - config.version = 2; - config.codec = ChannelConfig::CODEC_VERBATIM; - } root->AddElement(FormatChannelConfig(config, kAudioTag)); } -- cgit v1.1