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

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

Issue 2261523004: Signal to remove remote candidates if ports are pruned. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: . Created 4 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 204ff040a1deda0cff458a705c9d8beb708206bc..88927fd43ab1df000e7161fc62bce1ee296bdea0 100644
--- a/webrtc/p2p/client/basicportallocator.h
+++ b/webrtc/p2p/client/basicportallocator.h
@@ -142,8 +142,14 @@ class BasicPortAllocatorSession : public PortAllocatorSession,
return has_pairable_candidate_ && state_ != STATE_ERROR &&
state_ != STATE_PRUNED;
}
-
void set_pruned() { state_ = STATE_PRUNED; }
skvlad 2016/09/14 02:35:11 This doesn't seem to be called from anywhere else.
honghaiz3 2016/09/14 16:50:31 Done.
+ // Sets the state to "PRUNED" and prunes the Port.
+ void PrunePort() {
+ set_pruned();
+ if (port()) {
+ port()->Prune();
+ }
+ }
void set_has_pairable_candidate(bool has_pairable_candidate) {
if (has_pairable_candidate) {
ASSERT(state_ == STATE_INPROGRESS);
@@ -201,8 +207,12 @@ class BasicPortAllocatorSession : public PortAllocatorSession,
// in order to avoid leaking any information.
Candidate SanitizeRelatedAddress(const Candidate& c) const;
- // Removes the ports and candidates on given networks.
- void RemovePortsAndCandidates(const std::vector<rtc::Network*>& networks);
+ std::vector<PortData*> GetUnprunedPortsOnNetworks(
+ const std::vector<rtc::Network*>& networks);
+ // Prunes ports and signal the remote side to remove the candidates generated
+ // by these ports.
+ void PrunePortsAndRemoveCandidates(
+ const std::vector<PortData*>& port_data_list);
// Gets filtered and sanitized candidates generated from a port and
// append to |candidates|.
void GetCandidatesFromPort(const PortData& data,

Powered by Google App Engine
This is Rietveld 408576698