| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "remoting/protocol/content_description.h" | 5 #include "remoting/protocol/content_description.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
| 9 #include "remoting/base/constants.h" | 9 #include "remoting/base/constants.h" |
| 10 #include "remoting/protocol/authenticator.h" | 10 #include "remoting/protocol/authenticator.h" |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 configs->push_back(ChannelConfig::None()); | 207 configs->push_back(ChannelConfig::None()); |
| 208 } | 208 } |
| 209 return true; | 209 return true; |
| 210 } | 210 } |
| 211 | 211 |
| 212 // static | 212 // static |
| 213 scoped_ptr<ContentDescription> ContentDescription::ParseXml( | 213 scoped_ptr<ContentDescription> ContentDescription::ParseXml( |
| 214 const XmlElement* element) { | 214 const XmlElement* element) { |
| 215 if (element->Name() != QName(kChromotingXmlNamespace, kDescriptionTag)) { | 215 if (element->Name() != QName(kChromotingXmlNamespace, kDescriptionTag)) { |
| 216 LOG(ERROR) << "Invalid description: " << element->Str(); | 216 LOG(ERROR) << "Invalid description: " << element->Str(); |
| 217 return scoped_ptr<ContentDescription>(); | 217 return nullptr; |
| 218 } | 218 } |
| 219 scoped_ptr<CandidateSessionConfig> config( | 219 scoped_ptr<CandidateSessionConfig> config( |
| 220 CandidateSessionConfig::CreateEmpty()); | 220 CandidateSessionConfig::CreateEmpty()); |
| 221 if (!ParseChannelConfigs(element, kControlTag, false, false, | 221 if (!ParseChannelConfigs(element, kControlTag, false, false, |
| 222 config->mutable_control_configs()) || | 222 config->mutable_control_configs()) || |
| 223 !ParseChannelConfigs(element, kEventTag, false, false, | 223 !ParseChannelConfigs(element, kEventTag, false, false, |
| 224 config->mutable_event_configs()) || | 224 config->mutable_event_configs()) || |
| 225 !ParseChannelConfigs(element, kVideoTag, true, false, | 225 !ParseChannelConfigs(element, kVideoTag, true, false, |
| 226 config->mutable_video_configs()) || | 226 config->mutable_video_configs()) || |
| 227 !ParseChannelConfigs(element, kAudioTag, true, true, | 227 !ParseChannelConfigs(element, kAudioTag, true, true, |
| 228 config->mutable_audio_configs())) { | 228 config->mutable_audio_configs())) { |
| 229 return scoped_ptr<ContentDescription>(); | 229 return nullptr; |
| 230 } | 230 } |
| 231 | 231 |
| 232 scoped_ptr<XmlElement> authenticator_message; | 232 scoped_ptr<XmlElement> authenticator_message; |
| 233 const XmlElement* child = Authenticator::FindAuthenticatorMessage(element); | 233 const XmlElement* child = Authenticator::FindAuthenticatorMessage(element); |
| 234 if (child) | 234 if (child) |
| 235 authenticator_message.reset(new XmlElement(*child)); | 235 authenticator_message.reset(new XmlElement(*child)); |
| 236 | 236 |
| 237 return scoped_ptr<ContentDescription>( | 237 return scoped_ptr<ContentDescription>( |
| 238 new ContentDescription(config.Pass(), authenticator_message.Pass())); | 238 new ContentDescription(config.Pass(), authenticator_message.Pass())); |
| 239 } | 239 } |
| 240 | 240 |
| 241 } // namespace protocol | 241 } // namespace protocol |
| 242 } // namespace remoting | 242 } // namespace remoting |
| OLD | NEW |