| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "net/tools/quic/test_tools/server_thread.h" | 5 #include "net/tools/quic/test_tools/server_thread.h" |
| 6 | 6 |
| 7 #include "net/quic/test_tools/crypto_test_utils.h" | 7 #include "net/quic/test_tools/crypto_test_utils.h" |
| 8 #include "net/tools/quic/quic_dispatcher.h" | 8 #include "net/tools/quic/quic_dispatcher.h" |
| 9 #include "net/tools/quic/test_tools/quic_server_peer.h" | 9 #include "net/tools/quic/test_tools/quic_server_peer.h" |
| 10 | 10 |
| 11 namespace net { | 11 namespace net { |
| 12 namespace test { | 12 namespace test { |
| 13 | 13 |
| 14 ServerThread::ServerThread(QuicServer* server, | 14 ServerThread::ServerThread(QuicServer* server, const IPEndPoint& address) |
| 15 const IPEndPoint& address, | |
| 16 bool strike_register_no_startup_period) | |
| 17 : SimpleThread("server_thread"), | 15 : SimpleThread("server_thread"), |
| 18 confirmed_(base::WaitableEvent::ResetPolicy::MANUAL, | 16 confirmed_(base::WaitableEvent::ResetPolicy::MANUAL, |
| 19 base::WaitableEvent::InitialState::NOT_SIGNALED), | 17 base::WaitableEvent::InitialState::NOT_SIGNALED), |
| 20 pause_(base::WaitableEvent::ResetPolicy::MANUAL, | 18 pause_(base::WaitableEvent::ResetPolicy::MANUAL, |
| 21 base::WaitableEvent::InitialState::NOT_SIGNALED), | 19 base::WaitableEvent::InitialState::NOT_SIGNALED), |
| 22 paused_(base::WaitableEvent::ResetPolicy::MANUAL, | 20 paused_(base::WaitableEvent::ResetPolicy::MANUAL, |
| 23 base::WaitableEvent::InitialState::NOT_SIGNALED), | 21 base::WaitableEvent::InitialState::NOT_SIGNALED), |
| 24 resume_(base::WaitableEvent::ResetPolicy::MANUAL, | 22 resume_(base::WaitableEvent::ResetPolicy::MANUAL, |
| 25 base::WaitableEvent::InitialState::NOT_SIGNALED), | 23 base::WaitableEvent::InitialState::NOT_SIGNALED), |
| 26 quit_(base::WaitableEvent::ResetPolicy::MANUAL, | 24 quit_(base::WaitableEvent::ResetPolicy::MANUAL, |
| 27 base::WaitableEvent::InitialState::NOT_SIGNALED), | 25 base::WaitableEvent::InitialState::NOT_SIGNALED), |
| 28 server_(server), | 26 server_(server), |
| 29 address_(address), | 27 address_(address), |
| 30 port_(0), | 28 port_(0), |
| 31 initialized_(false) { | 29 initialized_(false) {} |
| 32 if (strike_register_no_startup_period) { | |
| 33 server_->SetStrikeRegisterNoStartupPeriod(); | |
| 34 } | |
| 35 } | |
| 36 | 30 |
| 37 ServerThread::~ServerThread() {} | 31 ServerThread::~ServerThread() {} |
| 38 | 32 |
| 39 void ServerThread::Initialize() { | 33 void ServerThread::Initialize() { |
| 40 if (initialized_) { | 34 if (initialized_) { |
| 41 return; | 35 return; |
| 42 } | 36 } |
| 43 | 37 |
| 44 server_->CreateUDPSocketAndListen(address_); | 38 server_->CreateUDPSocketAndListen(address_); |
| 45 | 39 |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 actions.swap(scheduled_actions_); | 121 actions.swap(scheduled_actions_); |
| 128 } | 122 } |
| 129 while (!actions.empty()) { | 123 while (!actions.empty()) { |
| 130 actions.front()(); | 124 actions.front()(); |
| 131 actions.pop_front(); | 125 actions.pop_front(); |
| 132 } | 126 } |
| 133 } | 127 } |
| 134 | 128 |
| 135 } // namespace test | 129 } // namespace test |
| 136 } // namespace net | 130 } // namespace net |
| OLD | NEW |