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

Side by Side Diff: remoting/protocol/content_description.cc

Issue 10831022: Skip unknown channel configurations when parsing session config. (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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 const XmlElement* const element, 228 const XmlElement* const element,
229 const char tag_name[], 229 const char tag_name[],
230 bool codec_required, 230 bool codec_required,
231 bool optional, 231 bool optional,
232 std::vector<ChannelConfig>* const configs) { 232 std::vector<ChannelConfig>* const configs) {
233 233
234 QName tag(kChromotingXmlNamespace, tag_name); 234 QName tag(kChromotingXmlNamespace, tag_name);
235 const XmlElement* child = element->FirstNamed(tag); 235 const XmlElement* child = element->FirstNamed(tag);
236 while (child) { 236 while (child) {
237 ChannelConfig channel_config; 237 ChannelConfig channel_config;
238 if (!ParseChannelConfig(child, codec_required, &channel_config)) 238 if (ParseChannelConfig(child, codec_required, &channel_config)) {
239 return false; 239 configs->push_back(channel_config);
240 configs->push_back(channel_config); 240 child = child->NextNamed(tag);
simonmorris 2012/07/26 16:11:06 The loop will go infinite if ParseChannelConfig ev
Sergey Ulanov 2012/07/26 22:54:45 Fixed.
241 child = child->NextNamed(tag); 241 }
242 } 242 }
243 if (optional && configs->empty()) { 243 if (optional && configs->empty()) {
244 // If there's no mention of the tag, implicitly assume 244 // If there's no mention of the tag, implicitly assume
245 // TRANSPORT_NONE for the channel. 245 // TRANSPORT_NONE for the channel.
246 configs->push_back(ChannelConfig(ChannelConfig::TRANSPORT_NONE, 246 configs->push_back(ChannelConfig(ChannelConfig::TRANSPORT_NONE,
247 kDefaultStreamVersion, 247 kDefaultStreamVersion,
248 ChannelConfig::CODEC_VERBATIM)); 248 ChannelConfig::CODEC_VERBATIM));
249 } 249 }
250 return true; 250 return true;
251 } 251 }
(...skipping 29 matching lines...) Expand all
281 authenticator_message.reset(new XmlElement(*child)); 281 authenticator_message.reset(new XmlElement(*child));
282 282
283 return new ContentDescription(config.Pass(), authenticator_message.Pass()); 283 return new ContentDescription(config.Pass(), authenticator_message.Pass());
284 } 284 }
285 LOG(ERROR) << "Invalid description: " << element->Str(); 285 LOG(ERROR) << "Invalid description: " << element->Str();
286 return NULL; 286 return NULL;
287 } 287 }
288 288
289 } // namespace protocol 289 } // namespace protocol
290 } // namespace remoting 290 } // namespace remoting
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698