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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « webrtc/base/network.h ('k') | webrtc/base/network_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 if (merged_list.size() != networks_.size()) { 310 if (merged_list.size() != networks_.size()) {
311 *changed = true; 311 *changed = true;
312 } 312 }
313 313
314 // If the network list changes, we re-assign |networks_| to the merged list 314 // If the network list changes, we re-assign |networks_| to the merged list
315 // and re-sort it. 315 // and re-sort it.
316 if (*changed) { 316 if (*changed) {
317 networks_ = merged_list; 317 networks_ = merged_list;
318 // Reset the active states of all networks. 318 // Reset the active states of all networks.
319 for (const auto& kv : networks_map_) { 319 for (const auto& kv : networks_map_) {
320 kv.second->set_active(false); 320 Network* network = kv.second;
321 } 321 // If |network| is in the newly generated |networks_|, it is active.
322 for (Network* network : networks_) { 322 bool found = std::find(networks_.begin(), networks_.end(), network) !=
323 network->set_active(true); 323 networks_.end();
324 network->set_active(found);
324 } 325 }
325 std::sort(networks_.begin(), networks_.end(), SortNetworks); 326 std::sort(networks_.begin(), networks_.end(), SortNetworks);
326 // Now network interfaces are sorted, we should set the preference value 327 // Now network interfaces are sorted, we should set the preference value
327 // for each of the interfaces we are planning to use. 328 // for each of the interfaces we are planning to use.
328 // Preference order of network interfaces might have changed from previous 329 // Preference order of network interfaces might have changed from previous
329 // sorting due to addition of higher preference network interface. 330 // sorting due to addition of higher preference network interface.
330 // Since we have already sorted the network interfaces based on our 331 // Since we have already sorted the network interfaces based on our
331 // requirements, we will just assign a preference value starting with 127, 332 // requirements, we will just assign a preference value starting with 127,
332 // in decreasing order. 333 // in decreasing order.
333 int pref = kHighestNetworkPreference; 334 int pref = kHighestNetworkPreference;
(...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after
918 std::stringstream ss; 919 std::stringstream ss;
919 // Print out the first space-terminated token of the network desc, plus 920 // Print out the first space-terminated token of the network desc, plus
920 // the IP address. 921 // the IP address.
921 ss << "Net[" << description_.substr(0, description_.find(' ')) 922 ss << "Net[" << description_.substr(0, description_.find(' '))
922 << ":" << prefix_.ToSensitiveString() << "/" << prefix_length_ 923 << ":" << prefix_.ToSensitiveString() << "/" << prefix_length_
923 << ":" << AdapterTypeToString(type_) << "]"; 924 << ":" << AdapterTypeToString(type_) << "]";
924 return ss.str(); 925 return ss.str();
925 } 926 }
926 927
927 } // namespace rtc 928 } // namespace rtc
OLDNEW
« 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