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

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

Issue 1361183004: When doing DisableEquivalentPhases, exclude those AllocationSequences (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Created 5 years, 3 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.h
diff --git a/webrtc/p2p/client/basicportallocator.h b/webrtc/p2p/client/basicportallocator.h
index a27ff4c6274f66e9b783d45238eaf83cee6fbe9f..f2c4a0ab516e99d986bc916ec8d2e95a82c2582a 100644
--- a/webrtc/p2p/client/basicportallocator.h
+++ b/webrtc/p2p/client/basicportallocator.h
@@ -182,6 +182,7 @@ class BasicPortAllocatorSession : public PortAllocatorSession,
void MaybeSignalCandidatesAllocationDone();
void OnPortAllocationComplete(AllocationSequence* seq);
PortData* FindPort(Port* port);
+ void GetNetworks(std::vector<rtc::Network*>* networks);
bool CheckCandidateFilter(const Candidate& c);
@@ -250,8 +251,12 @@ class AllocationSequence : public rtc::MessageHandler,
kRunning, // Started allocating ports.
kStopped, // Stopped from running.
kCompleted, // All ports are allocated.
+ kTerminated, // An AllocationSequence is terminated when the network
+ // it depends on is removed (disconnected).
pthatcher1 2015/09/24 17:11:43 How is that different than kStopped?
honghaiz3 2015/09/24 19:27:00 Removed the state.
// kInit --> kRunning --> {kCompleted|kStopped}
+ // | | |
+ // --------------------------------> kTerminated
};
AllocationSequence(BasicPortAllocatorSession* session,
rtc::Network* network,
@@ -260,8 +265,11 @@ class AllocationSequence : public rtc::MessageHandler,
~AllocationSequence();
bool Init();
void Clear();
+ void Terminate();
+ bool IsTerminated() { return state_ == kTerminated; }
pthatcher1 2015/09/24 17:11:43 Is this needed when you can just do state() == kTe
honghaiz3 2015/09/24 19:27:00 Removed the new state.
State state() const { return state_; }
+ const rtc::Network* network() const { return network_; }
// Disables the phases for a new sequence that this one already covers for an
// equivalent network setup.

Powered by Google App Engine
This is Rietveld 408576698