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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 if (name.empty() || address.empty() || !base::StringToInt(port_str, &port) || | 70 if (name.empty() || address.empty() || !base::StringToInt(port_str, &port) || |
71 port < kPortMin || port > kPortMax || type.empty() || protocol.empty() || | 71 port < kPortMin || port > kPortMax || type.empty() || protocol.empty() || |
72 username.empty() || password.empty() || | 72 username.empty() || password.empty() || |
73 !base::StringToDouble(preference_str, &preference) || | 73 !base::StringToDouble(preference_str, &preference) || |
74 !base::StringToInt(generation_str, &generation)) { | 74 !base::StringToInt(generation_str, &generation)) { |
75 return false; | 75 return false; |
76 } | 76 } |
77 | 77 |
78 candidate->name = name; | 78 candidate->name = name; |
79 | 79 |
80 candidate->candidate.set_address(rtc::SocketAddress(address, port)); | 80 candidate->candidate.set_address(talk_base::SocketAddress(address, port)); |
81 candidate->candidate.set_type(type); | 81 candidate->candidate.set_type(type); |
82 candidate->candidate.set_protocol(protocol); | 82 candidate->candidate.set_protocol(protocol); |
83 candidate->candidate.set_username(username); | 83 candidate->candidate.set_username(username); |
84 candidate->candidate.set_password(password); | 84 candidate->candidate.set_password(password); |
85 candidate->candidate.set_preference(static_cast<float>(preference)); | 85 candidate->candidate.set_preference(static_cast<float>(preference)); |
86 candidate->candidate.set_generation(generation); | 86 candidate->candidate.set_generation(generation); |
87 | 87 |
88 return true; | 88 return true; |
89 } | 89 } |
90 | 90 |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
421 text_elem->SetAttr(QName(kXmlNamespace, "lang"), "en"); | 421 text_elem->SetAttr(QName(kXmlNamespace, "lang"), "en"); |
422 text_elem->SetBodyText(error_text); | 422 text_elem->SetBodyText(error_text); |
423 error->AddElement(text_elem); | 423 error->AddElement(text_elem); |
424 } | 424 } |
425 | 425 |
426 return iq.Pass(); | 426 return iq.Pass(); |
427 } | 427 } |
428 | 428 |
429 } // namespace protocol | 429 } // namespace protocol |
430 } // namespace remoting | 430 } // namespace remoting |
OLD | NEW |