| 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/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 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 return false; | 337 return false; |
| 337 } | 338 } |
| 338 | 339 |
| 339 sid = jingle_tag->Attr(QName(kEmptyNamespace, "sid")); | 340 sid = jingle_tag->Attr(QName(kEmptyNamespace, "sid")); |
| 340 if (sid.empty()) { | 341 if (sid.empty()) { |
| 341 *error = "sid attribute is missing"; | 342 *error = "sid attribute is missing"; |
| 342 return false; | 343 return false; |
| 343 } | 344 } |
| 344 | 345 |
| 345 const XmlElement* attachments_tag = | 346 const XmlElement* attachments_tag = |
| 346 jingle_tag->FirstNamed(QName(kChromotingXmlNamespace, "attachments")); | 347 SessionPlugin::FindAttachments(*jingle_tag); |
| 347 if (attachments_tag) { | 348 if (attachments_tag) { |
| 348 attachments.reset(new XmlElement(*attachments_tag)); | 349 attachments.reset(new XmlElement(*attachments_tag)); |
| 349 } else { | 350 } else { |
| 350 attachments.reset(); | 351 attachments.reset(); |
| 351 } | 352 } |
| 352 | 353 |
| 353 if (action == SESSION_INFO) { | 354 if (action == SESSION_INFO) { |
| 354 // session-info messages may contain arbitrary information not | 355 // session-info messages may contain arbitrary information not |
| 355 // defined by the Jingle protocol. We don't need to parse it. | 356 // defined by the Jingle protocol. We don't need to parse it. |
| 356 const XmlElement* child = jingle_tag->FirstElement(); | 357 const XmlElement* child = jingle_tag->FirstElement(); |
| (...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 675 result->AddElement(FormatIceCredentials(credentials)); | 676 result->AddElement(FormatIceCredentials(credentials)); |
| 676 } | 677 } |
| 677 for (const NamedCandidate& candidate : candidates) { | 678 for (const NamedCandidate& candidate : candidates) { |
| 678 result->AddElement(FormatIceCandidate(candidate)); | 679 result->AddElement(FormatIceCandidate(candidate)); |
| 679 } | 680 } |
| 680 return result; | 681 return result; |
| 681 } | 682 } |
| 682 | 683 |
| 683 } // namespace protocol | 684 } // namespace protocol |
| 684 } // namespace remoting | 685 } // namespace remoting |
| OLD | NEW |