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

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: Fixing patch conflicts Created 5 years 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
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 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 return true; 350 return true;
351 } else if (family == AF_INET6 && !default_local_ipv6_address_.IsNil()) { 351 } else if (family == AF_INET6 && !default_local_ipv6_address_.IsNil()) {
352 *ipaddr = default_local_ipv6_address_; 352 *ipaddr = default_local_ipv6_address_;
353 return true; 353 return true;
354 } 354 }
355 return false; 355 return false;
356 } 356 }
357 357
358 BasicNetworkManager::BasicNetworkManager() 358 BasicNetworkManager::BasicNetworkManager()
359 : thread_(NULL), sent_first_update_(false), start_count_(0), 359 : thread_(NULL), sent_first_update_(false), start_count_(0),
360 network_ignore_mask_(kDefaultNetworkIgnoreMask),
361 ignore_non_default_routes_(false) { 360 ignore_non_default_routes_(false) {
362 } 361 }
363 362
364 BasicNetworkManager::~BasicNetworkManager() { 363 BasicNetworkManager::~BasicNetworkManager() {
365 } 364 }
366 365
367 void BasicNetworkManager::OnNetworksChanged() { 366 void BasicNetworkManager::OnNetworksChanged() {
368 LOG(LS_VERBOSE) << "Network change was observed at the network manager"; 367 LOG(LS_VERBOSE) << "Network change was observed at the network manager";
369 UpdateNetworksOnce(); 368 UpdateNetworksOnce();
370 } 369 }
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
648 #endif 647 #endif
649 648
650 bool BasicNetworkManager::IsIgnoredNetwork(const Network& network) const { 649 bool BasicNetworkManager::IsIgnoredNetwork(const Network& network) const {
651 // Ignore networks on the explicit ignore list. 650 // Ignore networks on the explicit ignore list.
652 for (const std::string& ignored_name : network_ignore_list_) { 651 for (const std::string& ignored_name : network_ignore_list_) {
653 if (network.name() == ignored_name) { 652 if (network.name() == ignored_name) {
654 return true; 653 return true;
655 } 654 }
656 } 655 }
657 656
658 if (network_ignore_mask_ & network.type()) {
659 return true;
660 }
661 #if defined(WEBRTC_POSIX) 657 #if defined(WEBRTC_POSIX)
662 // Filter out VMware/VirtualBox interfaces, typically named vmnet1, 658 // Filter out VMware/VirtualBox interfaces, typically named vmnet1,
663 // vmnet8, or vboxnet0. 659 // vmnet8, or vboxnet0.
664 if (strncmp(network.name().c_str(), "vmnet", 5) == 0 || 660 if (strncmp(network.name().c_str(), "vmnet", 5) == 0 ||
665 strncmp(network.name().c_str(), "vnic", 4) == 0 || 661 strncmp(network.name().c_str(), "vnic", 4) == 0 ||
666 strncmp(network.name().c_str(), "vboxnet", 7) == 0) { 662 strncmp(network.name().c_str(), "vboxnet", 7) == 0) {
667 return true; 663 return true;
668 } 664 }
669 #if defined(WEBRTC_LINUX) 665 #if defined(WEBRTC_LINUX)
670 // Make sure this is a default route, if we're ignoring non-defaults. 666 // Make sure this is a default route, if we're ignoring non-defaults.
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
911 std::stringstream ss; 907 std::stringstream ss;
912 // Print out the first space-terminated token of the network desc, plus 908 // Print out the first space-terminated token of the network desc, plus
913 // the IP address. 909 // the IP address.
914 ss << "Net[" << description_.substr(0, description_.find(' ')) 910 ss << "Net[" << description_.substr(0, description_.find(' '))
915 << ":" << prefix_.ToSensitiveString() << "/" << prefix_length_ 911 << ":" << prefix_.ToSensitiveString() << "/" << prefix_length_
916 << ":" << AdapterTypeToString(type_) << "]"; 912 << ":" << AdapterTypeToString(type_) << "]";
917 return ss.str(); 913 return ss.str();
918 } 914 }
919 915
920 } // namespace rtc 916 } // namespace rtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698