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

Unified Diff: net/quic/test_tools/simple_data_producer.cc

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, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/test_tools/simple_data_producer.h ('k') | net/quic/test_tools/simulator/quic_endpoint.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/test_tools/simple_data_producer.cc
diff --git a/net/quic/test_tools/simple_data_producer.cc b/net/quic/test_tools/simple_data_producer.cc
new file mode 100644
index 0000000000000000000000000000000000000000..c34d40b4fd0c3d8ffc601b8b0b8a6b8aad033f06
--- /dev/null
+++ b/net/quic/test_tools/simple_data_producer.cc
@@ -0,0 +1,37 @@
+// Copyright (c) 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "net/quic/test_tools/simple_data_producer.h"
+
+#include "net/quic/platform/api/quic_map_util.h"
+
+namespace net {
+
+namespace test {
+
+SimpleDataProducer::SimpleDataProducer() {}
+
+SimpleDataProducer::~SimpleDataProducer() {}
+
+void SimpleDataProducer::SaveStreamData(QuicStreamId id,
+ QuicIOVector iov,
+ size_t iov_offset,
+ QuicStreamOffset offset,
+ QuicByteCount data_length) {
+ if (!QuicContainsKey(send_buffer_map_, id)) {
+ send_buffer_map_[id].reset(new QuicStreamSendBuffer(&allocator_));
+ }
+ send_buffer_map_[id]->SaveStreamData(iov, iov_offset, offset, data_length);
+}
+
+bool SimpleDataProducer::WriteStreamData(QuicStreamId id,
+ QuicStreamOffset offset,
+ QuicByteCount data_length,
+ QuicDataWriter* writer) {
+ return send_buffer_map_[id]->WriteStreamData(offset, data_length, writer);
+}
+
+} // namespace test
+
+} // namespace net
« no previous file with comments | « net/quic/test_tools/simple_data_producer.h ('k') | net/quic/test_tools/simulator/quic_endpoint.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698