| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 // A toy server, which listens on a specified address for QUIC traffic and | 5 // A toy server, which listens on a specified address for QUIC traffic and |
| 6 // handles incoming responses. | 6 // handles incoming responses. |
| 7 | 7 |
| 8 #ifndef NET_QUIC_TOOLS_QUIC_SIMPLE_SERVER_H_ | 8 #ifndef NET_QUIC_TOOLS_QUIC_SIMPLE_SERVER_H_ |
| 9 #define NET_QUIC_TOOLS_QUIC_SIMPLE_SERVER_H_ | 9 #define NET_QUIC_TOOLS_QUIC_SIMPLE_SERVER_H_ |
| 10 | 10 |
| 11 #include <memory> | 11 #include <memory> |
| 12 | 12 |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "net/base/io_buffer.h" | 14 #include "net/base/io_buffer.h" |
| 15 #include "net/base/ip_endpoint.h" | 15 #include "net/base/ip_endpoint.h" |
| 16 #include "net/log/net_log.h" | 16 #include "net/log/net_log.h" |
| 17 #include "net/quic/chromium/quic_chromium_alarm_factory.h" | 17 #include "net/quic/chromium/quic_chromium_alarm_factory.h" |
| 18 #include "net/quic/chromium/quic_chromium_connection_helper.h" | 18 #include "net/quic/chromium/quic_chromium_connection_helper.h" |
| 19 #include "net/quic/core/crypto/quic_crypto_server_config.h" | 19 #include "net/quic/core/crypto/quic_crypto_server_config.h" |
| 20 #include "net/quic/core/quic_config.h" | 20 #include "net/quic/core/quic_config.h" |
| 21 #include "net/quic/core/quic_version_manager.h" | 21 #include "net/quic/core/quic_version_manager.h" |
| 22 #include "net/quic/platform/api/quic_clock.h" | 22 #include "net/quic/platform/impl/quic_chromium_clock.h" |
| 23 #include "net/tools/quic/quic_http_response_cache.h" | 23 #include "net/tools/quic/quic_http_response_cache.h" |
| 24 | 24 |
| 25 namespace net { | 25 namespace net { |
| 26 | 26 |
| 27 class UDPServerSocket; | 27 class UDPServerSocket; |
| 28 | 28 |
| 29 | 29 |
| 30 class QuicDispatcher; | 30 class QuicDispatcher; |
| 31 | 31 |
| 32 namespace test { | 32 namespace test { |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 | 67 |
| 68 // Initialize the internal state of the server. | 68 // Initialize the internal state of the server. |
| 69 void Initialize(); | 69 void Initialize(); |
| 70 | 70 |
| 71 QuicVersionManager version_manager_; | 71 QuicVersionManager version_manager_; |
| 72 | 72 |
| 73 // Accepts data from the framer and demuxes clients to sessions. | 73 // Accepts data from the framer and demuxes clients to sessions. |
| 74 std::unique_ptr<QuicDispatcher> dispatcher_; | 74 std::unique_ptr<QuicDispatcher> dispatcher_; |
| 75 | 75 |
| 76 // Used by the helper_ to time alarms. | 76 // Used by the helper_ to time alarms. |
| 77 QuicClock clock_; | 77 QuicChromiumClock clock_; |
| 78 | 78 |
| 79 // Used to manage the message loop. Owned by dispatcher_. | 79 // Used to manage the message loop. Owned by dispatcher_. |
| 80 QuicChromiumConnectionHelper* helper_; | 80 QuicChromiumConnectionHelper* helper_; |
| 81 | 81 |
| 82 // Used to manage the message loop. Owned by dispatcher_. | 82 // Used to manage the message loop. Owned by dispatcher_. |
| 83 QuicChromiumAlarmFactory* alarm_factory_; | 83 QuicChromiumAlarmFactory* alarm_factory_; |
| 84 | 84 |
| 85 // Listening socket. Also used for outbound client communication. | 85 // Listening socket. Also used for outbound client communication. |
| 86 std::unique_ptr<UDPServerSocket> socket_; | 86 std::unique_ptr<UDPServerSocket> socket_; |
| 87 | 87 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 117 QuicHttpResponseCache* response_cache_; | 117 QuicHttpResponseCache* response_cache_; |
| 118 | 118 |
| 119 base::WeakPtrFactory<QuicSimpleServer> weak_factory_; | 119 base::WeakPtrFactory<QuicSimpleServer> weak_factory_; |
| 120 | 120 |
| 121 DISALLOW_COPY_AND_ASSIGN(QuicSimpleServer); | 121 DISALLOW_COPY_AND_ASSIGN(QuicSimpleServer); |
| 122 }; | 122 }; |
| 123 | 123 |
| 124 } // namespace net | 124 } // namespace net |
| 125 | 125 |
| 126 #endif // NET_QUIC_TOOLS_QUIC_SIMPLE_SERVER_H_ | 126 #endif // NET_QUIC_TOOLS_QUIC_SIMPLE_SERVER_H_ |
| OLD | NEW |