OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 // TODO(pthatcher): Remove once Chromium's jingle/glue/utils.cc | 98 // TODO(pthatcher): Remove once Chromium's jingle/glue/utils.cc |
99 // doesn't use it. | 99 // doesn't use it. |
100 void set_preference(float preference) { | 100 void set_preference(float preference) { |
101 // Limiting priority to UINT_MAX when value exceeds uint32_t max. | 101 // Limiting priority to UINT_MAX when value exceeds uint32_t max. |
102 // This can happen for e.g. when preference = 3. | 102 // This can happen for e.g. when preference = 3. |
103 uint64_t prio_val = static_cast<uint64_t>(preference * 127) << 24; | 103 uint64_t prio_val = static_cast<uint64_t>(preference * 127) << 24; |
104 priority_ = static_cast<uint32_t>( | 104 priority_ = static_cast<uint32_t>( |
105 std::min(prio_val, static_cast<uint64_t>(UINT_MAX))); | 105 std::min(prio_val, static_cast<uint64_t>(UINT_MAX))); |
106 } | 106 } |
107 | 107 |
| 108 // TODO(honghaiz): Change to usernameFragment or ufrag. |
108 const std::string & username() const { return username_; } | 109 const std::string & username() const { return username_; } |
109 void set_username(const std::string & username) { username_ = username; } | 110 void set_username(const std::string & username) { username_ = username; } |
110 | 111 |
111 const std::string & password() const { return password_; } | 112 const std::string & password() const { return password_; } |
112 void set_password(const std::string & password) { password_ = password; } | 113 void set_password(const std::string & password) { password_ = password; } |
113 | 114 |
114 const std::string & type() const { return type_; } | 115 const std::string & type() const { return type_; } |
115 void set_type(const std::string & type) { type_ = type; } | 116 void set_type(const std::string & type) { type_ = type; } |
116 | 117 |
117 const std::string & network_name() const { return network_name_; } | 118 const std::string & network_name() const { return network_name_; } |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 virtual ~CandidateTranslator() {} | 243 virtual ~CandidateTranslator() {} |
243 virtual bool GetChannelNameFromComponent( | 244 virtual bool GetChannelNameFromComponent( |
244 int component, std::string* channel_name) const = 0; | 245 int component, std::string* channel_name) const = 0; |
245 virtual bool GetComponentFromChannelName( | 246 virtual bool GetComponentFromChannelName( |
246 const std::string& channel_name, int* component) const = 0; | 247 const std::string& channel_name, int* component) const = 0; |
247 }; | 248 }; |
248 | 249 |
249 } // namespace cricket | 250 } // namespace cricket |
250 | 251 |
251 #endif // WEBRTC_P2P_BASE_CANDIDATE_H_ | 252 #endif // WEBRTC_P2P_BASE_CANDIDATE_H_ |
OLD | NEW |