| 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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 } | 142 } |
| 143 void set_generation_str(const std::string& str) { | 143 void set_generation_str(const std::string& str) { |
| 144 std::istringstream ist(str); | 144 std::istringstream ist(str); |
| 145 ist >> generation_; | 145 ist >> generation_; |
| 146 } | 146 } |
| 147 | 147 |
| 148 // |network_cost| measures the cost/penalty of using this candidate. A network | 148 // |network_cost| measures the cost/penalty of using this candidate. A network |
| 149 // cost of 0 indicates this candidate can be used freely. A value of | 149 // cost of 0 indicates this candidate can be used freely. A value of |
| 150 // rtc::kNetworkCostMax indicates it should be used only as the last resort. | 150 // rtc::kNetworkCostMax indicates it should be used only as the last resort. |
| 151 void set_network_cost(uint16_t network_cost) { | 151 void set_network_cost(uint16_t network_cost) { |
| 152 RTC_DCHECK(network_cost <= rtc::kNetworkCostMax); | 152 RTC_DCHECK_LE(network_cost, rtc::kNetworkCostMax); |
| 153 network_cost_ = network_cost; | 153 network_cost_ = network_cost; |
| 154 } | 154 } |
| 155 uint16_t network_cost() const { return network_cost_; } | 155 uint16_t network_cost() const { return network_cost_; } |
| 156 | 156 |
| 157 // An ID assigned to the network hosting the candidate. | 157 // An ID assigned to the network hosting the candidate. |
| 158 uint16_t network_id() const { return network_id_; } | 158 uint16_t network_id() const { return network_id_; } |
| 159 void set_network_id(uint16_t network_id) { network_id_ = network_id; } | 159 void set_network_id(uint16_t network_id) { network_id_ = network_id; } |
| 160 | 160 |
| 161 const std::string& foundation() const { | 161 const std::string& foundation() const { |
| 162 return foundation_; | 162 return foundation_; |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 virtual ~CandidateTranslator() {} | 294 virtual ~CandidateTranslator() {} |
| 295 virtual bool GetChannelNameFromComponent( | 295 virtual bool GetChannelNameFromComponent( |
| 296 int component, std::string* channel_name) const = 0; | 296 int component, std::string* channel_name) const = 0; |
| 297 virtual bool GetComponentFromChannelName( | 297 virtual bool GetComponentFromChannelName( |
| 298 const std::string& channel_name, int* component) const = 0; | 298 const std::string& channel_name, int* component) const = 0; |
| 299 }; | 299 }; |
| 300 | 300 |
| 301 } // namespace cricket | 301 } // namespace cricket |
| 302 | 302 |
| 303 #endif // WEBRTC_P2P_BASE_CANDIDATE_H_ | 303 #endif // WEBRTC_P2P_BASE_CANDIDATE_H_ |
| OLD | NEW |