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

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

Issue 2963763003: In QUIC, send data is copied to streams rather than frames. Protected by FLAGS_quic_reloadable_flag… (Closed)
Patch Set: Rebase Created 3 years, 5 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
« no previous file with comments | « net/quic/test_tools/quic_test_utils.cc ('k') | net/quic/test_tools/simple_data_producer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2017 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_DATA_PRODUCER_H_
6 #define NET_QUIC_TEST_TOOLS_SIMPLE_DATA_PRODUCER_H_
7
8 #include <unordered_map>
9
10 #include "net/quic/core/quic_simple_buffer_allocator.h"
11 #include "net/quic/core/quic_stream_frame_data_producer.h"
12 #include "net/quic/core/quic_stream_send_buffer.h"
13
14 namespace net {
15
16 namespace test {
17
18 // A simple data producer which copies stream data into a map from stream
19 // id to send buffer.
20 class SimpleDataProducer : public QuicStreamFrameDataProducer {
21 public:
22 SimpleDataProducer();
23 ~SimpleDataProducer() override;
24
25 // QuicStreamFrameDataProducer methods:
26 void SaveStreamData(QuicStreamId id,
27 QuicIOVector iov,
28 size_t iov_offset,
29 QuicStreamOffset offset,
30 QuicByteCount data_length) override;
31 bool WriteStreamData(QuicStreamId id,
32 QuicStreamOffset offset,
33 QuicByteCount data_length,
34 QuicDataWriter* writer) override;
35
36 private:
37 using SendBufferMap =
38 std::unordered_map<QuicStreamId, std::unique_ptr<QuicStreamSendBuffer>>;
39
40 SendBufferMap send_buffer_map_;
41
42 SimpleBufferAllocator allocator_;
43 };
44
45 } // namespace test
46
47 } // namespace net
48
49 #endif // NET_QUIC_TEST_TOOLS_SIMPLE_DATA_PRODUCER_H_
OLDNEW
« no previous file with comments | « net/quic/test_tools/quic_test_utils.cc ('k') | net/quic/test_tools/simple_data_producer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698