Updating trunk VERSION from 2139.0 to 2140.0
[chromium-blink-merge.git] / net / tools / quic / quic_epoll_connection_helper.h
blob3198a144b59c30cddfb4870bce2719cfcf5e4b1f
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 Google-specific helper for QuicConnection which uses
6 // EpollAlarm for alarms, and used an int fd_ for writing data.
8 #ifndef NET_TOOLS_QUIC_QUIC_EPOLL_CONNECTION_HELPER_H_
9 #define NET_TOOLS_QUIC_QUIC_EPOLL_CONNECTION_HELPER_H_
11 #include <sys/types.h>
12 #include <set>
14 #include "net/quic/quic_connection.h"
15 #include "net/quic/quic_packet_writer.h"
16 #include "net/quic/quic_protocol.h"
17 #include "net/quic/quic_time.h"
18 #include "net/tools/quic/quic_default_packet_writer.h"
19 #include "net/tools/quic/quic_epoll_clock.h"
21 namespace net {
23 class EpollServer;
24 class QuicRandom;
26 namespace tools {
28 class AckAlarm;
29 class RetransmissionAlarm;
30 class SendAlarm;
31 class TimeoutAlarm;
33 class QuicEpollConnectionHelper : public QuicConnectionHelperInterface {
34 public:
35 explicit QuicEpollConnectionHelper(EpollServer* eps);
36 virtual ~QuicEpollConnectionHelper();
38 // QuicEpollConnectionHelperInterface
39 virtual const QuicClock* GetClock() const OVERRIDE;
40 virtual QuicRandom* GetRandomGenerator() OVERRIDE;
41 virtual QuicAlarm* CreateAlarm(QuicAlarm::Delegate* delegate) OVERRIDE;
43 EpollServer* epoll_server() { return epoll_server_; }
45 private:
46 friend class QuicConnectionPeer;
48 EpollServer* epoll_server_; // Not owned.
50 const QuicEpollClock clock_;
51 QuicRandom* random_generator_;
53 DISALLOW_COPY_AND_ASSIGN(QuicEpollConnectionHelper);
56 } // namespace tools
57 } // namespace net
59 #endif // NET_TOOLS_QUIC_QUIC_EPOLL_CONNECTION_HELPER_H_