OLD | NEW |
| (Empty) |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
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 QuicConnection which uses | |
6 // a TaskRunner for alarms, and uses a DatagramClientSocket for writing data. | |
7 | |
8 #ifndef NET_QUIC_QUIC_CONNECTION_HELPER_H_ | |
9 #define NET_QUIC_QUIC_CONNECTION_HELPER_H_ | |
10 | |
11 #include "net/quic/quic_connection.h" | |
12 | |
13 #include <set> | |
14 | |
15 #include "base/macros.h" | |
16 #include "base/memory/weak_ptr.h" | |
17 #include "net/base/ip_endpoint.h" | |
18 #include "net/quic/quic_protocol.h" | |
19 #include "net/quic/quic_simple_buffer_allocator.h" | |
20 #include "net/quic/quic_time.h" | |
21 #include "net/udp/datagram_client_socket.h" | |
22 | |
23 namespace base { | |
24 class TaskRunner; | |
25 } // namespace base | |
26 | |
27 namespace net { | |
28 | |
29 class QuicClock; | |
30 class QuicRandom; | |
31 | |
32 class NET_EXPORT_PRIVATE QuicConnectionHelper | |
33 : public QuicConnectionHelperInterface { | |
34 public: | |
35 QuicConnectionHelper(base::TaskRunner* task_runner, | |
36 const QuicClock* clock, | |
37 QuicRandom* random_generator); | |
38 ~QuicConnectionHelper() override; | |
39 | |
40 // QuicConnectionHelperInterface | |
41 const QuicClock* GetClock() const override; | |
42 QuicRandom* GetRandomGenerator() override; | |
43 QuicAlarm* CreateAlarm(QuicAlarm::Delegate* delegate) override; | |
44 QuicBufferAllocator* GetBufferAllocator() override; | |
45 | |
46 private: | |
47 base::TaskRunner* task_runner_; | |
48 const QuicClock* clock_; | |
49 QuicRandom* random_generator_; | |
50 SimpleBufferAllocator buffer_allocator_; | |
51 base::WeakPtrFactory<QuicConnectionHelper> weak_factory_; | |
52 | |
53 DISALLOW_COPY_AND_ASSIGN(QuicConnectionHelper); | |
54 }; | |
55 | |
56 } // namespace net | |
57 | |
58 #endif // NET_QUIC_QUIC_CONNECTION_HELPER_H_ | |
OLD | NEW |