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

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

Issue 1520963002: Removing webrtc::PortAllocatorFactoryInterface. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Trying to fix presubmit warning Created 4 years, 11 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 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 return true; 363 return true;
364 } else if (family == AF_INET6 && !default_local_ipv6_address_.IsNil()) { 364 } else if (family == AF_INET6 && !default_local_ipv6_address_.IsNil()) {
365 *ipaddr = default_local_ipv6_address_; 365 *ipaddr = default_local_ipv6_address_;
366 return true; 366 return true;
367 } 367 }
368 return false; 368 return false;
369 } 369 }
370 370
371 BasicNetworkManager::BasicNetworkManager() 371 BasicNetworkManager::BasicNetworkManager()
372 : thread_(NULL), sent_first_update_(false), start_count_(0), 372 : thread_(NULL), sent_first_update_(false), start_count_(0),
373 network_ignore_mask_(kDefaultNetworkIgnoreMask),
374 ignore_non_default_routes_(false) { 373 ignore_non_default_routes_(false) {
375 } 374 }
376 375
377 BasicNetworkManager::~BasicNetworkManager() { 376 BasicNetworkManager::~BasicNetworkManager() {
378 } 377 }
379 378
380 void BasicNetworkManager::OnNetworksChanged() { 379 void BasicNetworkManager::OnNetworksChanged() {
381 LOG(LS_VERBOSE) << "Network change was observed at the network manager"; 380 LOG(LS_VERBOSE) << "Network change was observed at the network manager";
382 UpdateNetworksOnce(); 381 UpdateNetworksOnce();
383 } 382 }
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
663 #endif 662 #endif
664 663
665 bool BasicNetworkManager::IsIgnoredNetwork(const Network& network) const { 664 bool BasicNetworkManager::IsIgnoredNetwork(const Network& network) const {
666 // Ignore networks on the explicit ignore list. 665 // Ignore networks on the explicit ignore list.
667 for (const std::string& ignored_name : network_ignore_list_) { 666 for (const std::string& ignored_name : network_ignore_list_) {
668 if (network.name() == ignored_name) { 667 if (network.name() == ignored_name) {
669 return true; 668 return true;
670 } 669 }
671 } 670 }
672 671
673 if (network_ignore_mask_ & network.type()) {
674 return true;
675 }
676 #if defined(WEBRTC_POSIX) 672 #if defined(WEBRTC_POSIX)
677 // Filter out VMware/VirtualBox interfaces, typically named vmnet1, 673 // Filter out VMware/VirtualBox interfaces, typically named vmnet1,
678 // vmnet8, or vboxnet0. 674 // vmnet8, or vboxnet0.
679 if (strncmp(network.name().c_str(), "vmnet", 5) == 0 || 675 if (strncmp(network.name().c_str(), "vmnet", 5) == 0 ||
680 strncmp(network.name().c_str(), "vnic", 4) == 0 || 676 strncmp(network.name().c_str(), "vnic", 4) == 0 ||
681 strncmp(network.name().c_str(), "vboxnet", 7) == 0) { 677 strncmp(network.name().c_str(), "vboxnet", 7) == 0) {
682 return true; 678 return true;
683 } 679 }
684 #if defined(WEBRTC_LINUX) 680 #if defined(WEBRTC_LINUX)
685 // Make sure this is a default route, if we're ignoring non-defaults. 681 // Make sure this is a default route, if we're ignoring non-defaults.
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
919 std::stringstream ss; 915 std::stringstream ss;
920 // Print out the first space-terminated token of the network desc, plus 916 // Print out the first space-terminated token of the network desc, plus
921 // the IP address. 917 // the IP address.
922 ss << "Net[" << description_.substr(0, description_.find(' ')) 918 ss << "Net[" << description_.substr(0, description_.find(' '))
923 << ":" << prefix_.ToSensitiveString() << "/" << prefix_length_ 919 << ":" << prefix_.ToSensitiveString() << "/" << prefix_length_
924 << ":" << AdapterTypeToString(type_) << "]"; 920 << ":" << AdapterTypeToString(type_) << "]";
925 return ss.str(); 921 return ss.str();
926 } 922 }
927 923
928 } // namespace rtc 924 } // 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