| 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/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/content_description.h" | 10 #include "remoting/protocol/content_description.h" |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 candidate->candidate.set_generation(generation); | 111 candidate->candidate.set_generation(generation); |
| 112 | 112 |
| 113 return true; | 113 return true; |
| 114 } | 114 } |
| 115 | 115 |
| 116 XmlElement* FormatCandidate(const JingleMessage::NamedCandidate& candidate) { | 116 XmlElement* FormatCandidate(const JingleMessage::NamedCandidate& candidate) { |
| 117 XmlElement* result = | 117 XmlElement* result = |
| 118 new XmlElement(QName(kP2PTransportNamespace, "candidate")); | 118 new XmlElement(QName(kP2PTransportNamespace, "candidate")); |
| 119 result->SetAttr(QName(kEmptyNamespace, "name"), candidate.name); | 119 result->SetAttr(QName(kEmptyNamespace, "name"), candidate.name); |
| 120 result->SetAttr(QName(kEmptyNamespace, "address"), | 120 result->SetAttr(QName(kEmptyNamespace, "address"), |
| 121 candidate.candidate.address().IPAsString()); | 121 candidate.candidate.address().HostAsURIString()); |
| 122 result->SetAttr(QName(kEmptyNamespace, "port"), | 122 result->SetAttr(QName(kEmptyNamespace, "port"), |
| 123 base::IntToString(candidate.candidate.address().port())); | 123 base::IntToString(candidate.candidate.address().port())); |
| 124 result->SetAttr(QName(kEmptyNamespace, "type"), candidate.candidate.type()); | 124 result->SetAttr(QName(kEmptyNamespace, "type"), candidate.candidate.type()); |
| 125 result->SetAttr(QName(kEmptyNamespace, "protocol"), | 125 result->SetAttr(QName(kEmptyNamespace, "protocol"), |
| 126 candidate.candidate.protocol()); | 126 candidate.candidate.protocol()); |
| 127 result->SetAttr(QName(kEmptyNamespace, "username"), | 127 result->SetAttr(QName(kEmptyNamespace, "username"), |
| 128 candidate.candidate.username()); | 128 candidate.candidate.username()); |
| 129 result->SetAttr(QName(kEmptyNamespace, "password"), | 129 result->SetAttr(QName(kEmptyNamespace, "password"), |
| 130 candidate.candidate.password()); | 130 candidate.candidate.password()); |
| 131 result->SetAttr(QName(kEmptyNamespace, "preference"), | 131 result->SetAttr(QName(kEmptyNamespace, "preference"), |
| (...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 text_elem->SetAttr(QName(kXmlNamespace, "lang"), "en"); | 448 text_elem->SetAttr(QName(kXmlNamespace, "lang"), "en"); |
| 449 text_elem->SetBodyText(error_text); | 449 text_elem->SetBodyText(error_text); |
| 450 error->AddElement(text_elem); | 450 error->AddElement(text_elem); |
| 451 } | 451 } |
| 452 | 452 |
| 453 return iq.Pass(); | 453 return iq.Pass(); |
| 454 } | 454 } |
| 455 | 455 |
| 456 } // namespace protocol | 456 } // namespace protocol |
| 457 } // namespace remoting | 457 } // namespace remoting |
| OLD | NEW |