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

Side by Side Diff: net/tools/quic/test_tools/packet_reordering_writer.h

Issue 2222393002: Make QuicDispatcher to queue packets for new connections while waiting for CHLOs. Flag protected by… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@129318081
Patch Set: add new files Created 4 years, 4 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef NET_TOOLS_QUIC_TEST_TOOLS_PACKET_REORDERING_WRITER_H_
6 #define NET_TOOLS_QUIC_TEST_TOOLS_PACKET_REORDERING_WRITER_H_
7
8 #include "net/tools/quic/quic_packet_writer_wrapper.h"
9
10 namespace net {
11
12 namespace test {
13
14 // This packet writer allows delaying writing the next packet after
15 // SetDelay(num_packets_to_wait)
16 // is called and buffer this packet and write it after it writes next
17 // |num_packets_to_wait| packets. It doesn't support delaying a packet while
18 // there is already a packet delayed.
19 class PacketReorderingWriter : public QuicPacketWriterWrapper {
20 public:
21 PacketReorderingWriter();
22
23 ~PacketReorderingWriter() override;
24
25 WriteResult WritePacket(const char* buffer,
26 size_t buf_len,
27 const IPAddress& self_address,
28 const IPEndPoint& peer_address,
29 PerPacketOptions* options) override;
30
31 void SetDelay(size_t num_packets_to_wait);
32
33 private:
34 bool delay_next_ = false;
35 size_t num_packets_to_wait_ = 0;
36 std::string delayed_data_;
37 IPAddress delayed_self_address_;
38 IPEndPoint delayed_peer_address_;
39 std::unique_ptr<PerPacketOptions> delayed_options_;
40 };
41
42 } // namespace test
43 } // namespace net
44
45 #endif // NET_TOOLS_QUIC_TEST_TOOLS_PACKET_REORDERING_WRITER_H_
OLDNEW
« no previous file with comments | « net/tools/quic/quic_dispatcher_test.cc ('k') | net/tools/quic/test_tools/packet_reordering_writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698