Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(60)

Side by Side Diff: net/quic/test_tools/quic_test_packet_maker.h

Issue 182523002: Land Recent QUIC Changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed rch's comments in Patch set 1 of CL 181463007 Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 // 4 //
5 // Provides a simple interface for QUIC tests to create a variety of packets. 5 // Provides a simple interface for QUIC tests to create a variety of packets.
6 6
7 #ifndef NET_QUIC_TEST_TOOLS_QUIC_TEST_PACKET_MAKER_H_ 7 #ifndef NET_QUIC_TEST_TOOLS_QUIC_TEST_PACKET_MAKER_H_
8 #define NET_QUIC_TEST_TOOLS_QUIC_TEST_PACKET_MAKER_H_ 8 #define NET_QUIC_TEST_TOOLS_QUIC_TEST_PACKET_MAKER_H_
9 9
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
11 #include "net/base/request_priority.h" 11 #include "net/base/request_priority.h"
12 #include "net/quic/quic_protocol.h" 12 #include "net/quic/quic_protocol.h"
13 #include "net/quic/quic_spdy_compressor.h" 13 #include "net/quic/quic_spdy_compressor.h"
14 #include "net/quic/test_tools/mock_random.h" 14 #include "net/quic/test_tools/mock_random.h"
15 #include "net/spdy/spdy_framer.h" 15 #include "net/spdy/spdy_framer.h"
16 #include "net/spdy/spdy_protocol.h" 16 #include "net/spdy/spdy_protocol.h"
17 17
18 namespace net { 18 namespace net {
19 namespace test { 19 namespace test {
20 20
21 class QuicTestPacketMaker { 21 class QuicTestPacketMaker {
22 public: 22 public:
23 QuicTestPacketMaker(QuicVersion version, QuicGuid guid); 23 QuicTestPacketMaker(QuicVersion version, QuicConnectionId connection_id);
24 ~QuicTestPacketMaker(); 24 ~QuicTestPacketMaker();
25 25
26 scoped_ptr<QuicEncryptedPacket> MakeRstPacket( 26 scoped_ptr<QuicEncryptedPacket> MakeRstPacket(
27 QuicPacketSequenceNumber num, 27 QuicPacketSequenceNumber num,
28 bool include_version, 28 bool include_version,
29 QuicStreamId stream_id, 29 QuicStreamId stream_id,
30 QuicRstStreamErrorCode error_code); 30 QuicRstStreamErrorCode error_code);
31 scoped_ptr<QuicEncryptedPacket> MakeAckAndRstPacket( 31 scoped_ptr<QuicEncryptedPacket> MakeAckAndRstPacket(
32 QuicPacketSequenceNumber num, 32 QuicPacketSequenceNumber num,
33 bool include_version, 33 bool include_version,
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 scoped_ptr<QuicEncryptedPacket> MakePacket( 77 scoped_ptr<QuicEncryptedPacket> MakePacket(
78 const QuicPacketHeader& header, 78 const QuicPacketHeader& header,
79 const QuicFrame& frame); 79 const QuicFrame& frame);
80 80
81 void InitializeHeader(QuicPacketSequenceNumber sequence_number, 81 void InitializeHeader(QuicPacketSequenceNumber sequence_number,
82 bool should_include_version); 82 bool should_include_version);
83 83
84 std::string SerializeHeaderBlock(const SpdyHeaderBlock& headers); 84 std::string SerializeHeaderBlock(const SpdyHeaderBlock& headers);
85 85
86 QuicVersion version_; 86 QuicVersion version_;
87 QuicGuid guid_; 87 QuicConnectionId connection_id_;
88 SpdyFramer spdy_request_framer_; 88 SpdyFramer spdy_request_framer_;
89 SpdyFramer spdy_response_framer_; 89 SpdyFramer spdy_response_framer_;
90 MockRandom random_generator_; 90 MockRandom random_generator_;
91 QuicPacketHeader header_; 91 QuicPacketHeader header_;
92 QuicSpdyCompressor compressor_; 92 QuicSpdyCompressor compressor_;
93 93
94 DISALLOW_COPY_AND_ASSIGN(QuicTestPacketMaker); 94 DISALLOW_COPY_AND_ASSIGN(QuicTestPacketMaker);
95 }; 95 };
96 96
97 } // namespace test 97 } // namespace test
98 } // namespace net 98 } // namespace net
99 99
100 #endif // NET_QUIC_TEST_TOOLS_QUIC_TEST_PACKET_MAKER_H_ 100 #endif // NET_QUIC_TEST_TOOLS_QUIC_TEST_PACKET_MAKER_H_
OLDNEW
« no previous file with comments | « net/quic/test_tools/quic_sent_packet_manager_peer.cc ('k') | net/quic/test_tools/quic_test_packet_maker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698