blob: 3198a144b59c30cddfb4870bce2719cfcf5e4b1f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// The Google-specific helper for QuicConnection which uses
// EpollAlarm for alarms, and used an int fd_ for writing data.
#ifndef NET_TOOLS_QUIC_QUIC_EPOLL_CONNECTION_HELPER_H_
#define NET_TOOLS_QUIC_QUIC_EPOLL_CONNECTION_HELPER_H_
#include <sys/types.h>
#include <set>
#include "net/quic/quic_connection.h"
#include "net/quic/quic_packet_writer.h"
#include "net/quic/quic_protocol.h"
#include "net/quic/quic_time.h"
#include "net/tools/quic/quic_default_packet_writer.h"
#include "net/tools/quic/quic_epoll_clock.h"
namespace net {
class EpollServer;
class QuicRandom;
namespace tools {
class AckAlarm;
class RetransmissionAlarm;
class SendAlarm;
class TimeoutAlarm;
class QuicEpollConnectionHelper : public QuicConnectionHelperInterface {
public:
explicit QuicEpollConnectionHelper(EpollServer* eps);
virtual ~QuicEpollConnectionHelper();
// QuicEpollConnectionHelperInterface
virtual const QuicClock* GetClock() const OVERRIDE;
virtual QuicRandom* GetRandomGenerator() OVERRIDE;
virtual QuicAlarm* CreateAlarm(QuicAlarm::Delegate* delegate) OVERRIDE;
EpollServer* epoll_server() { return epoll_server_; }
private:
friend class QuicConnectionPeer;
EpollServer* epoll_server_; // Not owned.
const QuicEpollClock clock_;
QuicRandom* random_generator_;
DISALLOW_COPY_AND_ASSIGN(QuicEpollConnectionHelper);
};
} // namespace tools
} // namespace net
#endif // NET_TOOLS_QUIC_QUIC_EPOLL_CONNECTION_HELPER_H_
|