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 #ifndef NET_QUIC_TEST_TOOLS_SIMPLE_QUIC_FRAMER_H_ 6 #define NET_QUIC_TEST_TOOLS_SIMPLE_QUIC_FRAMER_H_ 7 8 #include <vector> 9 10 #include "base/memory/scoped_ptr.h" 11 #include "net/quic/quic_framer.h" 12 #include "net/quic/quic_protocol.h" 13 14 namespace net { 15 16 class CryptoHandshakeMessage; 17 struct QuicAckFrame; 18 class QuicConnection; 19 class QuicConnectionVisitorInterface; 20 class QuicPacketCreator; 21 class ReceiveAlgorithmInterface; 22 class SendAlgorithmInterface; 23 24 namespace test { 25 26 class SimpleFramerVisitor; 27 28 // Peer to make public a number of otherwise private QuicFramer methods. 29 class SimpleQuicFramer { 30 public: 31 SimpleQuicFramer(); 32 ~SimpleQuicFramer(); 33 34 bool ProcessPacket(const QuicEncryptedPacket& packet); 35 bool ProcessPacket(const QuicPacket& packet); 36 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<QuicCongestionFeedbackFrame>& feedback_frames() const; 42 const std::vector<QuicGoAwayFrame>& goaway_frames() const; 43 const std::vector<QuicRstStreamFrame>& rst_stream_frames() const; 44 const std::vector<QuicStreamFrame>& stream_frames() const; 45 const QuicFecData& fec_data() const; 46 QuicFramer* framer(); 47 48 private: 49 QuicFramer framer_; 50 scoped_ptr<SimpleFramerVisitor> visitor_; 51 DISALLOW_COPY_AND_ASSIGN(SimpleQuicFramer); 52 }; 53 54 } // namespace test 55 56 } // namespace net 57 58 #endif // NET_QUIC_TEST_TOOLS_SIMPLE_QUIC_FRAMER_H_ 59