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

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: Merge to head and fix a comment 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
« no previous file with comments | « webrtc/base/virtualsocketserver.cc ('k') | webrtc/p2p/client/basicportallocator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/p2p/client/basicportallocator.h
diff --git a/webrtc/p2p/client/basicportallocator.h b/webrtc/p2p/client/basicportallocator.h
index 204ff040a1deda0cff458a705c9d8beb708206bc..3044559a0bab2cf0d48248c6af4707516d832dce 100644
--- a/webrtc/p2p/client/basicportallocator.h
+++ b/webrtc/p2p/client/basicportallocator.h
@@ -142,8 +142,13 @@ class BasicPortAllocatorSession : public PortAllocatorSession,
return has_pairable_candidate_ && state_ != STATE_ERROR &&
state_ != STATE_PRUNED;
}
-
- void set_pruned() { state_ = STATE_PRUNED; }
+ // Sets the state to "PRUNED" and prunes the Port.
+ void Prune() {
+ state_ = STATE_PRUNED;
+ if (port()) {
+ port()->Prune();
+ }
+ }
void set_has_pairable_candidate(bool has_pairable_candidate) {
if (has_pairable_candidate) {
ASSERT(state_ == STATE_INPROGRESS);
@@ -201,8 +206,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*> GetUnprunedPorts(
+ const std::vector<rtc::Network*>& networks);
+ // Prunes ports and signal the remote side to remove the candidates that
+ // were previously signaled from 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,
« no previous file with comments | « webrtc/base/virtualsocketserver.cc ('k') | webrtc/p2p/client/basicportallocator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698