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

Unified Diff: webrtc/p2p/client/basicportallocator.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 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/p2p/client/basicportallocator.h ('k') | webrtc/p2p/client/fakeportallocator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/p2p/client/basicportallocator.cc
diff --git a/webrtc/p2p/client/basicportallocator.cc b/webrtc/p2p/client/basicportallocator.cc
index a14f85b6f289c0516ef732540b9081b5e6146d05..e45d2c8f0f30ffec271d1804808c9de9d11cbecc 100644
--- a/webrtc/p2p/client/basicportallocator.cc
+++ b/webrtc/p2p/client/basicportallocator.cc
@@ -10,6 +10,7 @@
#include "webrtc/p2p/client/basicportallocator.h"
+#include <algorithm>
#include <string>
#include <vector>
@@ -70,15 +71,16 @@ BasicPortAllocator::BasicPortAllocator(
: network_manager_(network_manager),
socket_factory_(socket_factory),
stun_servers_() {
- ASSERT(socket_factory_ != NULL);
+ ASSERT(network_manager_ != nullptr);
+ ASSERT(socket_factory_ != nullptr);
Construct();
}
-BasicPortAllocator::BasicPortAllocator(
- rtc::NetworkManager* network_manager)
+BasicPortAllocator::BasicPortAllocator(rtc::NetworkManager* network_manager)
: network_manager_(network_manager),
- socket_factory_(NULL),
+ socket_factory_(nullptr),
stun_servers_() {
+ ASSERT(network_manager_ != nullptr);
Construct();
}
@@ -327,6 +329,12 @@ void BasicPortAllocatorSession::GetNetworks(
} else {
network_manager->GetNetworks(networks);
}
+ networks->erase(std::remove_if(networks->begin(), networks->end(),
+ [this](rtc::Network* network) {
+ return allocator_->network_ignore_mask() &
+ network->type();
+ }),
+ networks->end());
}
// For each network, see if we have a sequence that covers it already. If not,
« no previous file with comments | « webrtc/p2p/client/basicportallocator.h ('k') | webrtc/p2p/client/fakeportallocator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698