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

Unified Diff: webrtc/p2p/base/stunrequest.cc

Issue 1737493004: Keep on sending stun binding requests on zero-cost networks. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Added tests, chaneged to 64bit lifetime. Created 4 years, 10 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
« webrtc/p2p/base/stunport.cc ('K') | « webrtc/p2p/base/stunrequest.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/p2p/base/stunrequest.cc
diff --git a/webrtc/p2p/base/stunrequest.cc b/webrtc/p2p/base/stunrequest.cc
index ce0364e8db55e48bb6b7afd22d98d1ff2c1b3b04..f8a73e643283a5f3c7885222781b10fb14fb8ea9 100644
--- a/webrtc/p2p/base/stunrequest.cc
+++ b/webrtc/p2p/base/stunrequest.cc
@@ -63,6 +63,16 @@ void StunRequestManager::Flush(int msg_type) {
}
}
+bool StunRequestManager::Exist(int msg_type) {
pthatcher1 2016/03/02 20:25:59 I think HasAny might be a better name.
honghaiz3 2016/03/02 23:22:51 Done. using HasRequest
+ for (const auto kv : requests_) {
+ StunRequest* request = kv.second;
+ if (msg_type == kAllRequests || msg_type == request->type()) {
+ return true;
+ }
+ }
+ return false;
+}
+
void StunRequestManager::Remove(StunRequest* request) {
ASSERT(request->manager() == this);
RequestMap::iterator iter = requests_.find(request->id());
« webrtc/p2p/base/stunport.cc ('K') | « webrtc/p2p/base/stunrequest.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698