| 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 #ifndef NET_TOOLS_QUIC_TEST_TOOLS_SERVER_THREAD_H_ | 5 #ifndef NET_TOOLS_QUIC_TEST_TOOLS_SERVER_THREAD_H_ |
| 6 #define NET_TOOLS_QUIC_TEST_TOOLS_SERVER_THREAD_H_ | 6 #define NET_TOOLS_QUIC_TEST_TOOLS_SERVER_THREAD_H_ |
| 7 | 7 |
| 8 #include "base/threading/simple_thread.h" | 8 #include "base/threading/simple_thread.h" |
| 9 #include "net/base/ip_endpoint.h" | 9 #include "net/base/ip_endpoint.h" |
| 10 #include "net/quic/quic_config.h" | 10 #include "net/quic/quic_config.h" |
| 11 #include "net/tools/quic/quic_server.h" | 11 #include "net/tools/quic/quic_server.h" |
| 12 | 12 |
| 13 namespace net { | 13 namespace net { |
| 14 namespace tools { | 14 namespace tools { |
| 15 namespace test { | 15 namespace test { |
| 16 | 16 |
| 17 // Simple wrapper class to run QuicServer in a dedicated thread. | 17 // Simple wrapper class to run QuicServer in a dedicated thread. |
| 18 class ServerThread : public base::SimpleThread { | 18 class ServerThread : public base::SimpleThread { |
| 19 public: | 19 public: |
| 20 ServerThread(QuicServer* server, | 20 ServerThread(QuicServer* server, |
| 21 bool is_secure, | |
| 22 const IPEndPoint& address, | 21 const IPEndPoint& address, |
| 23 bool strike_register_no_startup_period); | 22 bool strike_register_no_startup_period); |
| 24 | 23 |
| 25 ~ServerThread() override; | 24 ~ServerThread() override; |
| 26 | 25 |
| 27 // Prepares the server, but does not start accepting connections. Useful for | 26 // Prepares the server, but does not start accepting connections. Useful for |
| 28 // injecting mocks. | 27 // injecting mocks. |
| 29 void Initialize(); | 28 void Initialize(); |
| 30 | 29 |
| 31 // Runs the event loop. Will initialize if necessary. | 30 // Runs the event loop. Will initialize if necessary. |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 bool initialized_; | 71 bool initialized_; |
| 73 | 72 |
| 74 DISALLOW_COPY_AND_ASSIGN(ServerThread); | 73 DISALLOW_COPY_AND_ASSIGN(ServerThread); |
| 75 }; | 74 }; |
| 76 | 75 |
| 77 } // namespace test | 76 } // namespace test |
| 78 } // namespace tools | 77 } // namespace tools |
| 79 } // namespace net | 78 } // namespace net |
| 80 | 79 |
| 81 #endif // NET_TOOLS_QUIC_TEST_TOOLS_SERVER_THREAD_H_ | 80 #endif // NET_TOOLS_QUIC_TEST_TOOLS_SERVER_THREAD_H_ |
| OLD | NEW |