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

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

Issue 1359363003: Make it possible to keep the port allocator session running (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Created 5 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 | « no previous file | webrtc/p2p/base/p2ptransportchannel_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/p2p/base/p2ptransportchannel.cc
diff --git a/webrtc/p2p/base/p2ptransportchannel.cc b/webrtc/p2p/base/p2ptransportchannel.cc
index 15ac006872e9087bf8af8cbe1fde783fd29f1160..d1b2330c62e2f386374425153048e4476c7c3edb 100644
--- a/webrtc/p2p/base/p2ptransportchannel.cc
+++ b/webrtc/p2p/base/p2ptransportchannel.cc
@@ -1072,8 +1072,16 @@ void P2PTransportChannel::HandleWritable() {
ASSERT(worker_thread_ == rtc::Thread::Current());
if (!writable()) {
pthatcher1 2015/09/28 23:34:00 Can you make an early return here? if (writable()
honghaiz3 2015/09/29 00:04:49 Done.
for (uint32 i = 0; i < allocator_sessions_.size(); ++i) {
- if (allocator_sessions_[i]->IsGettingPorts()) {
- allocator_sessions_[i]->StopGettingPorts();
+ PortAllocatorSession* session = allocator_sessions_[i];
+ if (!session->IsGettingPorts()) {
+ continue;
+ }
+ // If gathering continually, keep the last session running so that it
+ // will gather candidates if the networks change.
+ if (gather_continually_ && (i + 1 == allocator_sessions_.size())) {
+ session->ClearGettingPorts();
+ } else {
+ session->StopGettingPorts();
}
pthatcher1 2015/09/28 23:34:00 I think this would be more readable like this:
honghaiz3 2015/09/29 00:04:49 Done. Replaced continue with break because that is
}
}
« no previous file with comments | « no previous file | webrtc/p2p/base/p2ptransportchannel_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698