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/string_number_conversions.h" | 8 #include "base/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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 } else { | 139 } else { |
140 config->codec = ChannelConfig::CODEC_UNDEFINED; | 140 config->codec = ChannelConfig::CODEC_UNDEFINED; |
141 } | 141 } |
142 | 142 |
143 return true; | 143 return true; |
144 } | 144 } |
145 | 145 |
146 } // namespace | 146 } // namespace |
147 | 147 |
148 ContentDescription::ContentDescription( | 148 ContentDescription::ContentDescription( |
149 const CandidateSessionConfig* candidate_config, | 149 scoped_ptr<CandidateSessionConfig> config, |
150 const buzz::XmlElement* authenticator_message) | 150 scoped_ptr<buzz::XmlElement> authenticator_message) |
151 : candidate_config_(candidate_config), | 151 : candidate_config_(config.Pass()), |
152 authenticator_message_(authenticator_message) { | 152 authenticator_message_(authenticator_message.Pass()) { |
153 } | 153 } |
154 | 154 |
155 ContentDescription::~ContentDescription() { } | 155 ContentDescription::~ContentDescription() { } |
156 | 156 |
157 // ToXml() creates content description for chromoting session. The | 157 // ToXml() creates content description for chromoting session. The |
158 // description looks as follows: | 158 // description looks as follows: |
159 // <description xmlns="google:remoting"> | 159 // <description xmlns="google:remoting"> |
160 // <control transport="stream" version="1" /> | 160 // <control transport="stream" version="1" /> |
161 // <event transport="datagram" version="1" /> | 161 // <event transport="datagram" version="1" /> |
162 // <video transport="srtp" codec="vp8" version="1" /> | 162 // <video transport="srtp" codec="vp8" version="1" /> |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 return NULL; | 240 return NULL; |
241 config->mutable_video_configs()->push_back(channel_config); | 241 config->mutable_video_configs()->push_back(channel_config); |
242 child = child->NextNamed(video_tag); | 242 child = child->NextNamed(video_tag); |
243 } | 243 } |
244 | 244 |
245 scoped_ptr<XmlElement> authenticator_message; | 245 scoped_ptr<XmlElement> authenticator_message; |
246 child = Authenticator::FindAuthenticatorMessage(element); | 246 child = Authenticator::FindAuthenticatorMessage(element); |
247 if (child) | 247 if (child) |
248 authenticator_message.reset(new XmlElement(*child)); | 248 authenticator_message.reset(new XmlElement(*child)); |
249 | 249 |
250 return new ContentDescription( | 250 return new ContentDescription(config.Pass(), authenticator_message.Pass()); |
251 config.release(), authenticator_message.release()); | |
252 } | 251 } |
253 LOG(ERROR) << "Invalid description: " << element->Str(); | 252 LOG(ERROR) << "Invalid description: " << element->Str(); |
254 return NULL; | 253 return NULL; |
255 } | 254 } |
256 | 255 |
257 } // namespace protocol | 256 } // namespace protocol |
258 } // namespace remoting | 257 } // namespace remoting |
OLD | NEW |