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

Unified Diff: net/quic/quic_packet_generator.cc

Issue 1811043002: Landing Recent QUIC changes until 2016-03-15 16:26 UTC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add an export clause. Created 4 years, 9 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_packet_generator_test.cc » ('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 908872e05503a09f3e3ee60b025e7022eae7953a..25da2be97b8a6a03d0132bad251fd6031f064dbf 100644
--- a/net/quic/quic_packet_generator.cc
+++ b/net/quic/quic_packet_generator.cc
@@ -198,6 +198,10 @@ bool QuicPacketGenerator::HasQueuedFrames() const {
return packet_creator_.HasPendingFrames() || HasPendingFrames();
}
+bool QuicPacketGenerator::IsPendingPacketEmpty() const {
+ return !packet_creator_.HasPendingFrames();
+}
+
bool QuicPacketGenerator::HasPendingFrames() const {
return should_send_ack_ || should_send_stop_waiting_ ||
!queued_control_frames_.empty();
@@ -205,12 +209,16 @@ bool QuicPacketGenerator::HasPendingFrames() const {
bool QuicPacketGenerator::AddNextPendingFrame() {
if (should_send_ack_) {
- delegate_->PopulateAckFrame(&pending_ack_frame_);
- // If we can't this add the frame now, then we still need to do so later.
- should_send_ack_ =
- !packet_creator_.AddSavedFrame(QuicFrame(&pending_ack_frame_));
- // Return success if we have cleared out this flag (i.e., added the frame).
- // If we still need to send, then the frame is full, and we have failed.
+ if (FLAGS_quic_dont_copy_acks) {
+ should_send_ack_ =
+ !packet_creator_.AddSavedFrame(delegate_->GetUpdatedAckFrame());
+ } else {
+ delegate_->PopulateAckFrame(&pending_ack_frame_);
+ // If we can't this add the frame now, then we still need to do so later.
+ should_send_ack_ =
+ !packet_creator_.AddSavedFrame(QuicFrame(&pending_ack_frame_));
+ // Return success if we have added the frame.
+ }
return !should_send_ack_;
}
« no previous file with comments | « net/quic/quic_packet_generator.h ('k') | net/quic/quic_packet_generator_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698