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

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: inline set_pruned method 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..fe0a3b1df3ba22a929d5cdac10275059b25241e9 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 PrunePort() {
pthatcher1 2016/09/15 18:54:38 Why not just "Prune()"?
honghaiz3 2016/09/16 01:41:29 Done.
+ 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*> GetUnprunedPortsOnNetworks(
+ const std::vector<rtc::Network*>& networks);
+ // Prunes ports and signal the remote side to remove the candidates generated
+ // by these ports.
pthatcher1 2016/09/15 18:54:38 generated by these ports => that were previously s
honghaiz3 2016/09/16 01:41:29 I used that were previously signaled from these po
+ 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