Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(558)

Side by Side Diff: webrtc/p2p/base/candidate.h

Issue 1803063004: Reset the BWE when the network changes (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
142 142
143 // |network_cost| measures the cost/penalty of using this candidate. A network 143 // |network_cost| measures the cost/penalty of using this candidate. A network
144 // cost of 0 indicates this candidate can be used freely. A value of 144 // cost of 0 indicates this candidate can be used freely. A value of
145 // |kMaxNetworkCost| indicates it should be used only as the last resort. 145 // |kMaxNetworkCost| indicates it should be used only as the last resort.
146 void set_network_cost(uint32_t network_cost) { 146 void set_network_cost(uint32_t network_cost) {
147 ASSERT(network_cost <= kMaxNetworkCost); 147 ASSERT(network_cost <= kMaxNetworkCost);
148 network_cost_ = network_cost; 148 network_cost_ = network_cost;
149 } 149 }
150 uint32_t network_cost() const { return network_cost_; } 150 uint32_t network_cost() const { return network_cost_; }
151 151
152 // An ID assigned to the network hosting the candidate.
153 uint16_t network_id() const { return network_id_; }
154 void set_network_id(uint16_t network_id) { network_id_ = network_id; }
155
152 const std::string& foundation() const { 156 const std::string& foundation() const {
153 return foundation_; 157 return foundation_;
154 } 158 }
155 159
156 void set_foundation(const std::string& foundation) { 160 void set_foundation(const std::string& foundation) {
157 foundation_ = foundation; 161 foundation_ = foundation;
158 } 162 }
159 163
160 const rtc::SocketAddress & related_address() const { 164 const rtc::SocketAddress & related_address() const {
161 return related_address_; 165 return related_address_;
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 int component_; 250 int component_;
247 std::string protocol_; 251 std::string protocol_;
248 std::string relay_protocol_; 252 std::string relay_protocol_;
249 rtc::SocketAddress address_; 253 rtc::SocketAddress address_;
250 uint32_t priority_; 254 uint32_t priority_;
251 std::string username_; 255 std::string username_;
252 std::string password_; 256 std::string password_;
253 std::string type_; 257 std::string type_;
254 std::string network_name_; 258 std::string network_name_;
255 rtc::AdapterType network_type_; 259 rtc::AdapterType network_type_;
260 uint32_t network_cost_ = 0;
261 uint16_t network_id_ = 0;
256 uint32_t generation_; 262 uint32_t generation_;
257 std::string foundation_; 263 std::string foundation_;
258 rtc::SocketAddress related_address_; 264 rtc::SocketAddress related_address_;
259 std::string tcptype_; 265 std::string tcptype_;
260 uint32_t network_cost_ = 0;
261 std::string transport_name_; 266 std::string transport_name_;
262 }; 267 };
263 268
264 // Used during parsing and writing to map component to channel name 269 // Used during parsing and writing to map component to channel name
265 // and back. This is primarily for converting old G-ICE candidate 270 // and back. This is primarily for converting old G-ICE candidate
266 // signalling to new ICE candidate classes. 271 // signalling to new ICE candidate classes.
267 class CandidateTranslator { 272 class CandidateTranslator {
268 public: 273 public:
269 virtual ~CandidateTranslator() {} 274 virtual ~CandidateTranslator() {}
270 virtual bool GetChannelNameFromComponent( 275 virtual bool GetChannelNameFromComponent(
271 int component, std::string* channel_name) const = 0; 276 int component, std::string* channel_name) const = 0;
272 virtual bool GetComponentFromChannelName( 277 virtual bool GetComponentFromChannelName(
273 const std::string& channel_name, int* component) const = 0; 278 const std::string& channel_name, int* component) const = 0;
274 }; 279 };
275 280
276 } // namespace cricket 281 } // namespace cricket
277 282
278 #endif // WEBRTC_P2P_BASE_CANDIDATE_H_ 283 #endif // WEBRTC_P2P_BASE_CANDIDATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698