Chromium Code Reviews| 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 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 332 void set_scope_id(int id) { scope_id_ = id; } | 332 void set_scope_id(int id) { scope_id_ = id; } |
| 333 | 333 |
| 334 // Indicates whether this network should be ignored, perhaps because | 334 // Indicates whether this network should be ignored, perhaps because |
| 335 // the IP is 0, or the interface is one we know is invalid. | 335 // the IP is 0, or the interface is one we know is invalid. |
| 336 bool ignored() const { return ignored_; } | 336 bool ignored() const { return ignored_; } |
| 337 void set_ignored(bool ignored) { ignored_ = ignored; } | 337 void set_ignored(bool ignored) { ignored_ = ignored; } |
| 338 | 338 |
| 339 AdapterType type() const { return type_; } | 339 AdapterType type() const { return type_; } |
| 340 void set_type(AdapterType type) { type_ = type; } | 340 void set_type(AdapterType type) { type_ = type; } |
| 341 | 341 |
| 342 // Converts the key to an integer id. | |
| 343 int id() const { return static_cast<int>(std::hash<std::string>()(key_)); } | |
|
pthatcher1
2016/03/16 21:22:02
We should probably make this a uint16_t or uint32_
honghaiz3
2016/03/17 03:38:26
Done.
| |
| 344 | |
| 342 int preference() const { return preference_; } | 345 int preference() const { return preference_; } |
| 343 void set_preference(int preference) { preference_ = preference; } | 346 void set_preference(int preference) { preference_ = preference; } |
| 344 | 347 |
| 345 // When we enumerate networks and find a previously-seen network is missing, | 348 // When we enumerate networks and find a previously-seen network is missing, |
| 346 // we do not remove it (because it may be used elsewhere). Instead, we mark | 349 // we do not remove it (because it may be used elsewhere). Instead, we mark |
| 347 // it inactive, so that we can detect network changes properly. | 350 // it inactive, so that we can detect network changes properly. |
| 348 bool active() const { return active_; } | 351 bool active() const { return active_; } |
| 349 void set_active(bool active) { | 352 void set_active(bool active) { |
| 350 if (active_ == active) { | 353 if (active_ == active) { |
| 351 return; | 354 return; |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 372 AdapterType type_; | 375 AdapterType type_; |
| 373 int preference_; | 376 int preference_; |
| 374 bool active_ = true; | 377 bool active_ = true; |
| 375 | 378 |
| 376 friend class NetworkManager; | 379 friend class NetworkManager; |
| 377 }; | 380 }; |
| 378 | 381 |
| 379 } // namespace rtc | 382 } // namespace rtc |
| 380 | 383 |
| 381 #endif // WEBRTC_BASE_NETWORK_H_ | 384 #endif // WEBRTC_BASE_NETWORK_H_ |
| OLD | NEW |