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

Unified Diff: webrtc/p2p/client/basicportallocator.cc

Issue 2025573002: Use continual gathering to restore backup connections (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Add tests Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: webrtc/p2p/client/basicportallocator.cc
diff --git a/webrtc/p2p/client/basicportallocator.cc b/webrtc/p2p/client/basicportallocator.cc
index 20fc84a38a22fc05eeed1942a1231a1ba94aaf27..4bba1e615c038076bdf3411b71937082ee110a4e 100644
--- a/webrtc/p2p/client/basicportallocator.cc
+++ b/webrtc/p2p/client/basicportallocator.cc
@@ -215,6 +215,18 @@ void BasicPortAllocatorSession::ClearGettingPorts() {
sequences_[i]->Stop();
}
+void BasicPortAllocatorSession::InactivateNetworksInExistingSequences(
Taylor Brandstetter 2016/06/06 18:18:37 On second thought... If this method is always inte
honghaiz3 2016/06/07 16:42:06 Done, except the name. We are not re-gathering "p
+ std::vector<rtc::Network*>* networks) {
+ for (AllocationSequence* sequence : sequences_) {
+ if (!sequence->network_inactive() &&
+ (!networks ||
+ std::find(networks->begin(), networks->end(), sequence->network()) !=
+ networks->end())) {
+ sequence->OnNetworkInactivated();
+ }
+ }
+}
+
std::vector<PortInterface*> BasicPortAllocatorSession::ReadyPorts() const {
std::vector<PortInterface*> ret;
for (const PortData& port : ports_) {
@@ -501,10 +513,10 @@ void BasicPortAllocatorSession::OnNetworksChanged() {
for (AllocationSequence* sequence : sequences_) {
// Remove the network from the allocation sequence if it is not in
// |networks|.
- if (!sequence->network_removed() &&
+ if (!sequence->network_inactive() &&
std::find(networks.begin(), networks.end(), sequence->network()) ==
networks.end()) {
- sequence->OnNetworkRemoved();
+ sequence->OnNetworkInactivated();
}
}
@@ -793,10 +805,10 @@ void AllocationSequence::Clear() {
turn_ports_.clear();
}
-void AllocationSequence::OnNetworkRemoved() {
+void AllocationSequence::OnNetworkInactivated() {
// Stop the allocation sequence if its network is gone.
+ network_inactive_ = true;
Stop();
- network_removed_ = true;
}
AllocationSequence::~AllocationSequence() {
@@ -805,8 +817,8 @@ AllocationSequence::~AllocationSequence() {
void AllocationSequence::DisableEquivalentPhases(rtc::Network* network,
PortConfiguration* config, uint32_t* flags) {
- if (network_removed_) {
- // If the network of this allocation sequence has ever gone away,
+ if (network_inactive_) {
+ // If the network of this allocation sequence has ever become inactive,
// it won't be equivalent to the new network.
return;
}
« webrtc/p2p/client/basicportallocator.h ('K') | « webrtc/p2p/client/basicportallocator.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698