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

Unified Diff: net/tools/quic/quic_dispatcher.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/simulator/quic_endpoint.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/tools/quic/quic_dispatcher.cc
diff --git a/net/tools/quic/quic_dispatcher.cc b/net/tools/quic/quic_dispatcher.cc
index a5cb9a79b88191998bd2eec5ee40e5ba37660d41..cc17c8012174c3540345f2bdbc8f541153395a38 100644
--- a/net/tools/quic/quic_dispatcher.cc
+++ b/net/tools/quic/quic_dispatcher.cc
@@ -52,6 +52,8 @@ class DeleteSessionsAlarm : public QuicAlarm::Delegate {
// to be handed off to the time wait list manager.
class PacketCollector : public QuicPacketCreator::DelegateInterface {
public:
+ explicit PacketCollector(QuicBufferAllocator* allocator)
+ : send_buffer_(allocator) {}
~PacketCollector() override {}
void OnSerializedPacket(SerializedPacket* serialized_packet) override {
@@ -68,12 +70,32 @@ class PacketCollector : public QuicPacketCreator::DelegateInterface {
const string& error_details,
ConnectionCloseSource source) override {}
+ void SaveStreamData(QuicStreamId id,
+ QuicIOVector iov,
+ size_t iov_offset,
+ QuicStreamOffset offset,
+ QuicByteCount data_length) override {
+ DCHECK_EQ(kCryptoStreamId, id);
+ send_buffer_.SaveStreamData(iov, iov_offset, offset, data_length);
+ }
+
+ bool WriteStreamData(QuicStreamId id,
+ QuicStreamOffset offset,
+ QuicByteCount data_length,
+ QuicDataWriter* writer) override {
+ DCHECK_EQ(kCryptoStreamId, id);
+ return send_buffer_.WriteStreamData(offset, data_length, writer);
+ }
+
std::vector<std::unique_ptr<QuicEncryptedPacket>>* packets() {
return &packets_;
}
private:
std::vector<std::unique_ptr<QuicEncryptedPacket>> packets_;
+ // This is only needed until the packets are encrypted. Once packets are
+ // encrypted, the stream data is no longer required.
+ QuicStreamSendBuffer send_buffer_;
};
// Helper for statelessly closing connections by generating the
@@ -87,6 +109,7 @@ class StatelessConnectionTerminator {
QuicTimeWaitListManager* time_wait_list_manager)
: connection_id_(connection_id),
framer_(framer),
+ collector_(helper->GetBufferAllocator()),
creator_(connection_id,
framer,
helper->GetBufferAllocator(),
« no previous file with comments | « net/quic/test_tools/simulator/quic_endpoint.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698