Chromium Code Reviews| 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()); |