| 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 <memory> |
| 9 |
| 8 #include "base/macros.h" | 10 #include "base/macros.h" |
| 9 #include "base/threading/simple_thread.h" | 11 #include "base/threading/simple_thread.h" |
| 10 #include "net/base/ip_endpoint.h" | 12 #include "net/base/ip_endpoint.h" |
| 11 #include "net/quic/quic_config.h" | 13 #include "net/quic/quic_config.h" |
| 12 #include "net/tools/quic/quic_server.h" | 14 #include "net/tools/quic/quic_server.h" |
| 13 | 15 |
| 14 namespace net { | 16 namespace net { |
| 15 namespace test { | 17 namespace test { |
| 16 | 18 |
| 17 // Simple wrapper class to run QuicServer in a dedicated thread. | 19 // Simple wrapper class to run QuicServer in a dedicated thread. |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 private: | 58 private: |
| 57 void MaybeNotifyOfHandshakeConfirmation(); | 59 void MaybeNotifyOfHandshakeConfirmation(); |
| 58 | 60 |
| 59 base::WaitableEvent confirmed_; // Notified when the first handshake is | 61 base::WaitableEvent confirmed_; // Notified when the first handshake is |
| 60 // confirmed. | 62 // confirmed. |
| 61 base::WaitableEvent pause_; // Notified when the server should pause. | 63 base::WaitableEvent pause_; // Notified when the server should pause. |
| 62 base::WaitableEvent paused_; // Notitied when the server has paused | 64 base::WaitableEvent paused_; // Notitied when the server has paused |
| 63 base::WaitableEvent resume_; // Notified when the server should resume. | 65 base::WaitableEvent resume_; // Notified when the server should resume. |
| 64 base::WaitableEvent quit_; // Notified when the server should quit. | 66 base::WaitableEvent quit_; // Notified when the server should quit. |
| 65 | 67 |
| 66 scoped_ptr<QuicServer> server_; | 68 std::unique_ptr<QuicServer> server_; |
| 67 IPEndPoint address_; | 69 IPEndPoint address_; |
| 68 base::Lock port_lock_; | 70 base::Lock port_lock_; |
| 69 int port_; | 71 int port_; |
| 70 | 72 |
| 71 bool initialized_; | 73 bool initialized_; |
| 72 | 74 |
| 73 DISALLOW_COPY_AND_ASSIGN(ServerThread); | 75 DISALLOW_COPY_AND_ASSIGN(ServerThread); |
| 74 }; | 76 }; |
| 75 | 77 |
| 76 } // namespace test | 78 } // namespace test |
| 77 } // namespace net | 79 } // namespace net |
| 78 | 80 |
| 79 #endif // NET_TOOLS_QUIC_TEST_TOOLS_SERVER_THREAD_H_ | 81 #endif // NET_TOOLS_QUIC_TEST_TOOLS_SERVER_THREAD_H_ |
| OLD | NEW |