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" |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 | 151 |
152 XmlElement* FormatIceCandidate(const JingleMessage::NamedCandidate& candidate) { | 152 XmlElement* FormatIceCandidate(const JingleMessage::NamedCandidate& candidate) { |
153 XmlElement* result = | 153 XmlElement* result = |
154 new XmlElement(QName(kIceTransportNamespace, "candidate")); | 154 new XmlElement(QName(kIceTransportNamespace, "candidate")); |
155 result->SetAttr(QName(kEmptyNamespace, "name"), candidate.name); | 155 result->SetAttr(QName(kEmptyNamespace, "name"), candidate.name); |
156 result->SetAttr(QName(kEmptyNamespace, "foundation"), | 156 result->SetAttr(QName(kEmptyNamespace, "foundation"), |
157 candidate.candidate.foundation()); | 157 candidate.candidate.foundation()); |
158 result->SetAttr(QName(kEmptyNamespace, "address"), | 158 result->SetAttr(QName(kEmptyNamespace, "address"), |
159 candidate.candidate.address().ipaddr().ToString()); | 159 candidate.candidate.address().ipaddr().ToString()); |
160 result->SetAttr(QName(kEmptyNamespace, "port"), | 160 result->SetAttr(QName(kEmptyNamespace, "port"), |
161 base::IntToString(candidate.candidate.address().port())); | 161 base::UintToString(candidate.candidate.address().port())); |
162 result->SetAttr(QName(kEmptyNamespace, "type"), candidate.candidate.type()); | 162 result->SetAttr(QName(kEmptyNamespace, "type"), candidate.candidate.type()); |
163 result->SetAttr(QName(kEmptyNamespace, "protocol"), | 163 result->SetAttr(QName(kEmptyNamespace, "protocol"), |
164 candidate.candidate.protocol()); | 164 candidate.candidate.protocol()); |
165 result->SetAttr(QName(kEmptyNamespace, "priority"), | 165 result->SetAttr(QName(kEmptyNamespace, "priority"), |
166 base::DoubleToString(candidate.candidate.priority())); | 166 base::UintToString(candidate.candidate.priority())); |
167 result->SetAttr(QName(kEmptyNamespace, "generation"), | 167 result->SetAttr(QName(kEmptyNamespace, "generation"), |
168 base::IntToString(candidate.candidate.generation())); | 168 base::UintToString(candidate.candidate.generation())); |
169 return result; | 169 return result; |
170 } | 170 } |
171 | 171 |
172 } // namespace | 172 } // namespace |
173 | 173 |
174 JingleMessage::NamedCandidate::NamedCandidate( | 174 JingleMessage::NamedCandidate::NamedCandidate( |
175 const std::string& name, | 175 const std::string& name, |
176 const cricket::Candidate& candidate) | 176 const cricket::Candidate& candidate) |
177 : name(name), | 177 : name(name), |
178 candidate(candidate) { | 178 candidate(candidate) { |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
470 text_elem->SetAttr(QName(kXmlNamespace, "lang"), "en"); | 470 text_elem->SetAttr(QName(kXmlNamespace, "lang"), "en"); |
471 text_elem->SetBodyText(error_text); | 471 text_elem->SetBodyText(error_text); |
472 error->AddElement(text_elem); | 472 error->AddElement(text_elem); |
473 } | 473 } |
474 | 474 |
475 return iq.Pass(); | 475 return iq.Pass(); |
476 } | 476 } |
477 | 477 |
478 } // namespace protocol | 478 } // namespace protocol |
479 } // namespace remoting | 479 } // namespace remoting |
OLD | NEW |