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

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

Issue 2586403003: [Chromoting] Add SessionPlugin in JingleSession (Closed)
Patch Set: Resolve review comments Created 3 years, 12 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
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/jingle_messages.h" 5 #include "remoting/protocol/jingle_messages.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/content_description.h" 10 #include "remoting/protocol/content_description.h"
11 #include "remoting/protocol/name_value_map.h" 11 #include "remoting/protocol/name_value_map.h"
12 #include "remoting/protocol/session_plugin.h"
12 #include "remoting/signaling/jid_util.h" 13 #include "remoting/signaling/jid_util.h"
13 #include "remoting/signaling/remoting_bot.h" 14 #include "remoting/signaling/remoting_bot.h"
14 #include "third_party/webrtc/libjingle/xmllite/xmlelement.h" 15 #include "third_party/webrtc/libjingle/xmllite/xmlelement.h"
15 16
16 using buzz::QName; 17 using buzz::QName;
17 using buzz::XmlElement; 18 using buzz::XmlElement;
18 19
19 namespace remoting { 20 namespace remoting {
20 namespace protocol { 21 namespace protocol {
21 22
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after
504 content_tag->AddElement(new XmlElement(*transport_info)); 505 content_tag->AddElement(new XmlElement(*transport_info));
505 } else if (description && description->config()->webrtc_supported()) { 506 } else if (description && description->config()->webrtc_supported()) {
506 content_tag->AddElement( 507 content_tag->AddElement(
507 new XmlElement(QName(kWebrtcTransportNamespace, "transport"))); 508 new XmlElement(QName(kWebrtcTransportNamespace, "transport")));
508 } 509 }
509 } 510 }
510 511
511 return root; 512 return root;
512 } 513 }
513 514
515 void JingleMessage::AddAttachment(std::unique_ptr<XmlElement> attachment) {
516 DCHECK(attachment);
517 if (!attachments) {
518 attachments.reset(new XmlElement(
519 QName(kChromotingXmlNamespace, "attachments")));
520 }
521 attachments->AddElement(attachment.release());
522 }
523
514 JingleMessageReply::JingleMessageReply() 524 JingleMessageReply::JingleMessageReply()
515 : type(REPLY_RESULT), 525 : type(REPLY_RESULT),
516 error_type(NONE) { 526 error_type(NONE) {
517 } 527 }
518 528
519 JingleMessageReply::JingleMessageReply(ErrorType error) 529 JingleMessageReply::JingleMessageReply(ErrorType error)
520 : type(error != NONE ? REPLY_ERROR : REPLY_RESULT), 530 : type(error != NONE ? REPLY_ERROR : REPLY_RESULT),
521 error_type(error) { 531 error_type(error) {
522 } 532 }
523 533
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
675 result->AddElement(FormatIceCredentials(credentials)); 685 result->AddElement(FormatIceCredentials(credentials));
676 } 686 }
677 for (const NamedCandidate& candidate : candidates) { 687 for (const NamedCandidate& candidate : candidates) {
678 result->AddElement(FormatIceCandidate(candidate)); 688 result->AddElement(FormatIceCandidate(candidate));
679 } 689 }
680 return result; 690 return result;
681 } 691 }
682 692
683 } // namespace protocol 693 } // namespace protocol
684 } // namespace remoting 694 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698