| OLD | NEW |
| 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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 socket_factory_ = owned_socket_factory_.get(); | 182 socket_factory_ = owned_socket_factory_.get(); |
| 183 } | 183 } |
| 184 | 184 |
| 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(bool keep_session_running) { |
| 193 ASSERT(rtc::Thread::Current() == network_thread_); | 193 ASSERT(rtc::Thread::Current() == network_thread_); |
| 194 running_ = false; | 194 running_ = keep_session_running; |
| 195 network_thread_->Clear(this, MSG_ALLOCATE); | 195 network_thread_->Clear(this, MSG_ALLOCATE); |
| 196 for (uint32 i = 0; i < sequences_.size(); ++i) | 196 for (uint32 i = 0; i < sequences_.size(); ++i) |
| 197 sequences_[i]->Stop(); | 197 sequences_[i]->Stop(); |
| 198 network_thread_->Post(this, MSG_CONFIG_STOP); | 198 network_thread_->Post(this, MSG_CONFIG_STOP); |
| 199 } | 199 } |
| 200 | 200 |
| 201 void BasicPortAllocatorSession::OnMessage(rtc::Message *message) { | 201 void BasicPortAllocatorSession::OnMessage(rtc::Message *message) { |
| 202 switch (message->message_id) { | 202 switch (message->message_id) { |
| 203 case MSG_CONFIG_START: | 203 case MSG_CONFIG_START: |
| 204 ASSERT(rtc::Thread::Current() == network_thread_); | 204 ASSERT(rtc::Thread::Current() == network_thread_); |
| (...skipping 935 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1140 ServerAddresses servers; | 1140 ServerAddresses servers; |
| 1141 for (size_t i = 0; i < relays.size(); ++i) { | 1141 for (size_t i = 0; i < relays.size(); ++i) { |
| 1142 if (relays[i].type == turn_type && SupportsProtocol(relays[i], type)) { | 1142 if (relays[i].type == turn_type && SupportsProtocol(relays[i], type)) { |
| 1143 servers.insert(relays[i].ports.front().address); | 1143 servers.insert(relays[i].ports.front().address); |
| 1144 } | 1144 } |
| 1145 } | 1145 } |
| 1146 return servers; | 1146 return servers; |
| 1147 } | 1147 } |
| 1148 | 1148 |
| 1149 } // namespace cricket | 1149 } // namespace cricket |
| OLD | NEW |