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

Unified Diff: net/quic/quic_framer.cc

Issue 734063004: Update from https://crrev.com/304418 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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_flags.cc ('k') | net/quic/quic_http_stream_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_framer.cc
diff --git a/net/quic/quic_framer.cc b/net/quic/quic_framer.cc
index e2487b4bd07a5fe1cbdde60e322ddcb0c1c1bfae..d2a7694631df431fb0f2e68d4169d0e2c85026c4 100644
--- a/net/quic/quic_framer.cc
+++ b/net/quic/quic_framer.cc
@@ -978,30 +978,30 @@ uint8 QuicFramer::GetSequenceNumberFlags(
QuicFramer::AckFrameInfo QuicFramer::GetAckFrameInfo(
const QuicAckFrame& frame) {
AckFrameInfo ack_info;
- if (!frame.missing_packets.empty()) {
- DCHECK_GE(frame.largest_observed, *frame.missing_packets.rbegin());
- size_t cur_range_length = 0;
- SequenceNumberSet::const_iterator iter = frame.missing_packets.begin();
- QuicPacketSequenceNumber last_missing = *iter;
- ++iter;
- for (; iter != frame.missing_packets.end(); ++iter) {
- if (cur_range_length != numeric_limits<uint8>::max() &&
- *iter == (last_missing + 1)) {
- ++cur_range_length;
- } else {
- ack_info.nack_ranges[last_missing - cur_range_length] =
- cur_range_length;
- cur_range_length = 0;
- }
- ack_info.max_delta = max(ack_info.max_delta, *iter - last_missing);
- last_missing = *iter;
+ if (frame.missing_packets.empty()) {
+ return ack_info;
+ }
+ DCHECK_GE(frame.largest_observed, *frame.missing_packets.rbegin());
+ size_t cur_range_length = 0;
+ SequenceNumberSet::const_iterator iter = frame.missing_packets.begin();
+ QuicPacketSequenceNumber last_missing = *iter;
+ ++iter;
+ for (; iter != frame.missing_packets.end(); ++iter) {
+ if (cur_range_length != numeric_limits<uint8>::max() &&
+ *iter == (last_missing + 1)) {
+ ++cur_range_length;
+ } else {
+ ack_info.nack_ranges[last_missing - cur_range_length] = cur_range_length;
+ cur_range_length = 0;
}
- // Include the last nack range.
- ack_info.nack_ranges[last_missing - cur_range_length] = cur_range_length;
- // Include the range to the largest observed.
- ack_info.max_delta = max(ack_info.max_delta,
- frame.largest_observed - last_missing);
- }
+ ack_info.max_delta = max(ack_info.max_delta, *iter - last_missing);
+ last_missing = *iter;
+ }
+ // Include the last nack range.
+ ack_info.nack_ranges[last_missing - cur_range_length] = cur_range_length;
+ // Include the range to the largest observed.
+ ack_info.max_delta =
+ max(ack_info.max_delta, frame.largest_observed - last_missing);
return ack_info;
}
« no previous file with comments | « net/quic/quic_flags.cc ('k') | net/quic/quic_http_stream_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698