Roll src/third_party/WebKit d9c6159:8139f33 (svn 201974:201975)
[chromium-blink-merge.git] / net / quic / test_tools / simple_quic_framer.h
blob8628a3f2d9f99c95fb83cbd940cfc8590aec78cc
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.
5 #ifndef NET_QUIC_TEST_TOOLS_SIMPLE_QUIC_FRAMER_H_
6 #define NET_QUIC_TEST_TOOLS_SIMPLE_QUIC_FRAMER_H_
8 #include <vector>
10 #include "base/basictypes.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "net/quic/quic_framer.h"
13 #include "net/quic/quic_protocol.h"
15 namespace net {
17 struct QuicAckFrame;
18 class QuicConnection;
19 class QuicConnectionVisitorInterface;
20 class QuicPacketCreator;
21 class SendAlgorithmInterface;
23 namespace test {
25 class SimpleFramerVisitor;
27 // Peer to make public a number of otherwise private QuicFramer methods.
28 class SimpleQuicFramer {
29 public:
30 SimpleQuicFramer();
31 explicit SimpleQuicFramer(const QuicVersionVector& supported_versions);
32 ~SimpleQuicFramer();
34 bool ProcessPacket(const QuicEncryptedPacket& packet);
35 void Reset();
37 const QuicPacketHeader& header() const;
38 size_t num_frames() const;
39 const std::vector<QuicAckFrame>& ack_frames() const;
40 const std::vector<QuicConnectionCloseFrame>& connection_close_frames() const;
41 const std::vector<QuicStopWaitingFrame>& stop_waiting_frames() const;
42 const std::vector<QuicPingFrame>& ping_frames() const;
43 const std::vector<QuicGoAwayFrame>& goaway_frames() const;
44 const std::vector<QuicRstStreamFrame>& rst_stream_frames() const;
45 const std::vector<QuicStreamFrame>& stream_frames() const;
46 const QuicFecData& fec_data() const;
47 const QuicVersionNegotiationPacket* version_negotiation_packet() const;
49 QuicFramer* framer();
51 void SetSupportedVersions(const QuicVersionVector& versions) {
52 framer_.SetSupportedVersions(versions);
55 private:
56 QuicFramer framer_;
57 scoped_ptr<SimpleFramerVisitor> visitor_;
58 DISALLOW_COPY_AND_ASSIGN(SimpleQuicFramer);
61 } // namespace test
63 } // namespace net
65 #endif // NET_QUIC_TEST_TOOLS_SIMPLE_QUIC_FRAMER_H_