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

Unified Diff: net/quic/quic_packet_generator.cc

Issue 23464033: Land Recent QUIC changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix valgrind error Created 7 years, 3 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/quic_packet_generator.h ('k') | net/quic/quic_protocol.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_packet_generator.cc
diff --git a/net/quic/quic_packet_generator.cc b/net/quic/quic_packet_generator.cc
index c684cda6e8d973f451d8f47066e20067e4c2b7aa..41161eb21543c07d58e6692585491d863a9d89c9 100644
--- a/net/quic/quic_packet_generator.cc
+++ b/net/quic/quic_packet_generator.cc
@@ -12,6 +12,8 @@ using base::StringPiece;
namespace net {
+class QuicAckNotifier;
+
QuicPacketGenerator::QuicPacketGenerator(DelegateInterface* delegate,
DebugDelegateInterface* debug_delegate,
QuicPacketCreator* creator)
@@ -60,7 +62,6 @@ void QuicPacketGenerator::SetShouldSendAck(bool also_send_feedback) {
SendQueuedFrames();
}
-
void QuicPacketGenerator::AddControlFrame(const QuicFrame& frame) {
queued_control_frames_.push_back(frame);
SendQueuedFrames();
@@ -70,6 +71,14 @@ QuicConsumedData QuicPacketGenerator::ConsumeData(QuicStreamId id,
StringPiece data,
QuicStreamOffset offset,
bool fin) {
+ return ConsumeData(id, data, offset, fin, NULL);
+}
+
+QuicConsumedData QuicPacketGenerator::ConsumeData(QuicStreamId id,
+ StringPiece data,
+ QuicStreamOffset offset,
+ bool fin,
+ QuicAckNotifier* notifier) {
IsHandshake handshake = id == kCryptoStreamId ? IS_HANDSHAKE : NOT_HANDSHAKE;
// The caller should have flushed pending frames before sending handshake
// messages.
@@ -82,8 +91,15 @@ QuicConsumedData QuicPacketGenerator::ConsumeData(QuicStreamId id,
while (delegate_->CanWrite(NOT_RETRANSMISSION, HAS_RETRANSMITTABLE_DATA,
handshake)) {
QuicFrame frame;
- size_t bytes_consumed = packet_creator_->CreateStreamFrame(
+ size_t bytes_consumed;
+ if (notifier != NULL) {
+ // We want to track which packet this stream frame ends up in.
+ bytes_consumed = packet_creator_->CreateStreamFrameWithNotifier(
+ id, data, offset + total_bytes_consumed, fin, notifier, &frame);
+ } else {
+ bytes_consumed = packet_creator_->CreateStreamFrame(
id, data, offset + total_bytes_consumed, fin, &frame);
+ }
bool success = AddFrame(frame);
DCHECK(success);
« no previous file with comments | « net/quic/quic_packet_generator.h ('k') | net/quic/quic_protocol.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698