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

Side by Side Diff: webrtc/base/network.cc

Issue 1815473002: Add 16-bit network id to the candidate signaling. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Remove the old NETWORK_COST attribute. 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
« 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 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 // Result of Network merge. Element in this list should have unique key. 279 // Result of Network merge. Element in this list should have unique key.
280 NetworkList merged_list; 280 NetworkList merged_list;
281 for (const auto& kv : consolidated_address_list) { 281 for (const auto& kv : consolidated_address_list) {
282 const std::string& key = kv.first; 282 const std::string& key = kv.first;
283 Network* net = kv.second.net; 283 Network* net = kv.second.net;
284 auto existing = networks_map_.find(key); 284 auto existing = networks_map_.find(key);
285 if (existing == networks_map_.end()) { 285 if (existing == networks_map_.end()) {
286 // This network is new. Place it in the network map. 286 // This network is new. Place it in the network map.
287 merged_list.push_back(net); 287 merged_list.push_back(net);
288 networks_map_[key] = net; 288 networks_map_[key] = net;
289 net->set_id(next_available_network_id_++);
289 // Also, we might have accumulated IPAddresses from the first 290 // Also, we might have accumulated IPAddresses from the first
290 // step, set it here. 291 // step, set it here.
291 net->SetIPs(kv.second.ips, true); 292 net->SetIPs(kv.second.ips, true);
292 *changed = true; 293 *changed = true;
293 } else { 294 } else {
294 // This network exists in the map already. Reset its IP addresses. 295 // This network exists in the map already. Reset its IP addresses.
295 Network* existing_net = existing->second; 296 Network* existing_net = existing->second;
296 *changed = existing_net->SetIPs(kv.second.ips, *changed); 297 *changed = existing_net->SetIPs(kv.second.ips, *changed);
297 merged_list.push_back(existing_net); 298 merged_list.push_back(existing_net);
298 // If the existing network was not active, networks have changed. 299 // If the existing network was not active, networks have changed.
(...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after
919 std::stringstream ss; 920 std::stringstream ss;
920 // Print out the first space-terminated token of the network desc, plus 921 // Print out the first space-terminated token of the network desc, plus
921 // the IP address. 922 // the IP address.
922 ss << "Net[" << description_.substr(0, description_.find(' ')) 923 ss << "Net[" << description_.substr(0, description_.find(' '))
923 << ":" << prefix_.ToSensitiveString() << "/" << prefix_length_ 924 << ":" << prefix_.ToSensitiveString() << "/" << prefix_length_
924 << ":" << AdapterTypeToString(type_) << "]"; 925 << ":" << AdapterTypeToString(type_) << "]";
925 return ss.str(); 926 return ss.str();
926 } 927 }
927 928
928 } // namespace rtc 929 } // 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