1 // Copyright 2012 The Chromium Authors 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 // 5 // The Chrome-specific helper for quic::QuicConnection which uses 6 // a TaskRunner for alarms, and uses a DatagramClientSocket for writing data. 7 8 #ifndef NET_QUIC_QUIC_CHROMIUM_CONNECTION_HELPER_H_ 9 #define NET_QUIC_QUIC_CHROMIUM_CONNECTION_HELPER_H_ 10 11 #include "base/memory/raw_ptr.h" 12 #include "net/base/ip_endpoint.h" 13 #include "net/base/net_export.h" 14 #include "net/socket/datagram_client_socket.h" 15 #include "net/third_party/quiche/src/quiche/common/simple_buffer_allocator.h" 16 #include "net/third_party/quiche/src/quiche/quic/core/quic_connection.h" 17 #include "net/third_party/quiche/src/quiche/quic/core/quic_packets.h" 18 #include "net/third_party/quiche/src/quiche/quic/core/quic_time.h" 19 20 namespace quic { 21 class QuicClock; 22 } // namespace quic 23 24 namespace quiche { 25 class QuicRandom; 26 } // namespace quiche 27 28 namespace net { 29 30 class NET_EXPORT_PRIVATE QuicChromiumConnectionHelper 31 : public quic::QuicConnectionHelperInterface { 32 public: 33 QuicChromiumConnectionHelper(const quic::QuicClock* clock, 34 quic::QuicRandom* random_generator); 35 36 QuicChromiumConnectionHelper(const QuicChromiumConnectionHelper&) = delete; 37 QuicChromiumConnectionHelper& operator=(const QuicChromiumConnectionHelper&) = 38 delete; 39 40 ~QuicChromiumConnectionHelper() override; 41 42 // quic::QuicConnectionHelperInterface 43 const quic::QuicClock* GetClock() const override; 44 quic::QuicRandom* GetRandomGenerator() override; 45 quiche::QuicheBufferAllocator* GetStreamSendBufferAllocator() override; 46 47 private: 48 raw_ptr<const quic::QuicClock> clock_; 49 raw_ptr<quic::QuicRandom> random_generator_; 50 }; 51 52 } // namespace net 53 54 #endif // NET_QUIC_QUIC_CHROMIUM_CONNECTION_HELPER_H_ 55