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

Side by Side Diff: webrtc/p2p/client/basicportallocator.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, 2 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 unified diff | Download patch
« no previous file with comments | « webrtc/p2p/client/basicportallocator.h ('k') | webrtc/p2p/client/fakeportallocator.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 running_ = true; 185 running_ = true;
186 network_thread_->Post(this, MSG_CONFIG_START); 186 network_thread_->Post(this, MSG_CONFIG_START);
187 187
188 if (flags() & PORTALLOCATOR_ENABLE_SHAKER) 188 if (flags() & PORTALLOCATOR_ENABLE_SHAKER)
189 network_thread_->PostDelayed(ShakeDelay(), this, MSG_SHAKE); 189 network_thread_->PostDelayed(ShakeDelay(), this, MSG_SHAKE);
190 } 190 }
191 191
192 void BasicPortAllocatorSession::StopGettingPorts() { 192 void BasicPortAllocatorSession::StopGettingPorts() {
193 ASSERT(rtc::Thread::Current() == network_thread_); 193 ASSERT(rtc::Thread::Current() == network_thread_);
194 running_ = false; 194 running_ = false;
195 network_thread_->Post(this, MSG_CONFIG_STOP);
196 ClearGettingPorts();
197 }
198
199 void BasicPortAllocatorSession::ClearGettingPorts() {
195 network_thread_->Clear(this, MSG_ALLOCATE); 200 network_thread_->Clear(this, MSG_ALLOCATE);
196 for (uint32 i = 0; i < sequences_.size(); ++i) 201 for (uint32 i = 0; i < sequences_.size(); ++i)
197 sequences_[i]->Stop(); 202 sequences_[i]->Stop();
198 network_thread_->Post(this, MSG_CONFIG_STOP);
199 } 203 }
200 204
201 void BasicPortAllocatorSession::OnMessage(rtc::Message *message) { 205 void BasicPortAllocatorSession::OnMessage(rtc::Message *message) {
202 switch (message->message_id) { 206 switch (message->message_id) {
203 case MSG_CONFIG_START: 207 case MSG_CONFIG_START:
204 ASSERT(rtc::Thread::Current() == network_thread_); 208 ASSERT(rtc::Thread::Current() == network_thread_);
205 GetPortConfigurations(); 209 GetPortConfigurations();
206 break; 210 break;
207 211
208 case MSG_CONFIG_READY: 212 case MSG_CONFIG_READY:
(...skipping 962 matching lines...) Expand 10 before | Expand all | Expand 10 after
1171 ServerAddresses servers; 1175 ServerAddresses servers;
1172 for (size_t i = 0; i < relays.size(); ++i) { 1176 for (size_t i = 0; i < relays.size(); ++i) {
1173 if (relays[i].type == turn_type && SupportsProtocol(relays[i], type)) { 1177 if (relays[i].type == turn_type && SupportsProtocol(relays[i], type)) {
1174 servers.insert(relays[i].ports.front().address); 1178 servers.insert(relays[i].ports.front().address);
1175 } 1179 }
1176 } 1180 }
1177 return servers; 1181 return servers;
1178 } 1182 }
1179 1183
1180 } // namespace cricket 1184 } // namespace cricket
OLDNEW
« no previous file with comments | « webrtc/p2p/client/basicportallocator.h ('k') | webrtc/p2p/client/fakeportallocator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698