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

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

Issue 5382008: Refactor ZLib and Verbatim encoders. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 10 years 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
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/jingle_session_manager.h" 5 #include "remoting/protocol/jingle_session_manager.h"
6 6
7 #include "base/message_loop.h" 7 #include "base/message_loop.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/jingle_glue/jingle_thread.h" 10 #include "remoting/jingle_glue/jingle_thread.h"
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 const XmlElement* child = NULL; 358 const XmlElement* child = NULL;
359 359
360 // <control> tags. 360 // <control> tags.
361 QName control_tag(kChromotingXmlNamespace, kControlTag); 361 QName control_tag(kChromotingXmlNamespace, kControlTag);
362 child = element->FirstNamed(control_tag); 362 child = element->FirstNamed(control_tag);
363 while (child) { 363 while (child) {
364 ChannelConfig channel_config; 364 ChannelConfig channel_config;
365 if (!ParseChannelConfig(child, false, &channel_config)) 365 if (!ParseChannelConfig(child, false, &channel_config))
366 return false; 366 return false;
367 config->mutable_control_configs()->push_back(channel_config); 367 config->mutable_control_configs()->push_back(channel_config);
368 child = element->NextNamed(control_tag); 368 child = child->NextNamed(control_tag);
369 } 369 }
370 370
371 // <event> tags. 371 // <event> tags.
372 QName event_tag(kChromotingXmlNamespace, kEventTag); 372 QName event_tag(kChromotingXmlNamespace, kEventTag);
373 child = element->FirstNamed(event_tag); 373 child = element->FirstNamed(event_tag);
374 while (child) { 374 while (child) {
375 ChannelConfig channel_config; 375 ChannelConfig channel_config;
376 if (!ParseChannelConfig(child, false, &channel_config)) 376 if (!ParseChannelConfig(child, false, &channel_config))
377 return false; 377 return false;
378 config->mutable_event_configs()->push_back(channel_config); 378 config->mutable_event_configs()->push_back(channel_config);
379 child = element->NextNamed(event_tag); 379 child = child->NextNamed(event_tag);
380 } 380 }
381 381
382 // <video> tags. 382 // <video> tags.
383 QName video_tag(kChromotingXmlNamespace, kVideoTag); 383 QName video_tag(kChromotingXmlNamespace, kVideoTag);
384 child = element->FirstNamed(video_tag); 384 child = element->FirstNamed(video_tag);
385 while (child) { 385 while (child) {
386 ChannelConfig channel_config; 386 ChannelConfig channel_config;
387 if (!ParseChannelConfig(child, true, &channel_config)) 387 if (!ParseChannelConfig(child, true, &channel_config))
388 return false; 388 return false;
389 config->mutable_video_configs()->push_back(channel_config); 389 config->mutable_video_configs()->push_back(channel_config);
390 child = element->NextNamed(video_tag); 390 child = child->NextNamed(video_tag);
391 } 391 }
392 392
393 // <initial-resolution> tag. 393 // <initial-resolution> tag.
394 child = element->FirstNamed(QName(kChromotingXmlNamespace, kResolutionTag)); 394 child = element->FirstNamed(QName(kChromotingXmlNamespace, kResolutionTag));
395 if (!child) 395 if (!child)
396 return false; // Resolution must always be specified. 396 return false; // Resolution must always be specified.
397 int width; 397 int width;
398 int height; 398 int height;
399 if (!base::StringToInt(child->Attr(QName(kDefaultNs, kWidthAttr)), 399 if (!base::StringToInt(child->Attr(QName(kDefaultNs, kWidthAttr)),
400 &width) || 400 &width) ||
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 const std::string& auth_token) { 476 const std::string& auth_token) {
477 cricket::SessionDescription* desc = new cricket::SessionDescription(); 477 cricket::SessionDescription* desc = new cricket::SessionDescription();
478 desc->AddContent(JingleSession::kChromotingContentName, 478 desc->AddContent(JingleSession::kChromotingContentName,
479 kChromotingXmlNamespace, 479 kChromotingXmlNamespace,
480 new ContentDescription(config, auth_token)); 480 new ContentDescription(config, auth_token));
481 return desc; 481 return desc;
482 } 482 }
483 483
484 } // namespace protocol 484 } // namespace protocol
485 } // namespace remoting 485 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698