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

Unified Diff: webrtc/base/network.cc

Issue 1696933003: When doing continual gathering, remove local candidates when a network is dropped. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Fix a type conversion error on Windows Created 4 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/base/network.h ('k') | webrtc/base/network_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/network.cc
diff --git a/webrtc/base/network.cc b/webrtc/base/network.cc
index 6b04f891a1bc56c61678024f3587b02815b1f67d..4f3b91981e4f08cef9a318e1be96af00c54eece5 100644
--- a/webrtc/base/network.cc
+++ b/webrtc/base/network.cc
@@ -317,10 +317,11 @@ void NetworkManagerBase::MergeNetworkList(const NetworkList& new_networks,
networks_ = merged_list;
// Reset the active states of all networks.
for (const auto& kv : networks_map_) {
- kv.second->set_active(false);
- }
- for (Network* network : networks_) {
- network->set_active(true);
+ Network* network = kv.second;
+ // If |network| is in the newly generated |networks_|, it is active.
+ bool found = std::find(networks_.begin(), networks_.end(), network) !=
+ networks_.end();
+ network->set_active(found);
}
std::sort(networks_.begin(), networks_.end(), SortNetworks);
// Now network interfaces are sorted, we should set the preference value
« no previous file with comments | « webrtc/base/network.h ('k') | webrtc/base/network_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698