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

Side by Side Diff: net/quic/quic_framer.cc

Issue 941933002: win vs2015: fix variable shadowing warnings in net/quic (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/quic/quic_framer.h" 5 #include "net/quic/quic_framer.h"
6 6
7 #include "base/containers/hash_tables.h" 7 #include "base/containers/hash_tables.h"
8 #include "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "net/quic/crypto/crypto_framer.h" 9 #include "net/quic/crypto/crypto_framer.h"
10 #include "net/quic/crypto/crypto_handshake_message.h" 10 #include "net/quic/crypto/crypto_handshake_message.h"
(...skipping 1329 matching lines...) Expand 10 before | Expand all | Expand 10 after
1340 if (!reader_->ReadBytes(&missing_delta, missing_sequence_number_length)) { 1340 if (!reader_->ReadBytes(&missing_delta, missing_sequence_number_length)) {
1341 set_detailed_error("Unable to read missing sequence number delta."); 1341 set_detailed_error("Unable to read missing sequence number delta.");
1342 return false; 1342 return false;
1343 } 1343 }
1344 last_sequence_number -= missing_delta; 1344 last_sequence_number -= missing_delta;
1345 QuicPacketSequenceNumber range_length = 0; 1345 QuicPacketSequenceNumber range_length = 0;
1346 if (!reader_->ReadBytes(&range_length, PACKET_1BYTE_SEQUENCE_NUMBER)) { 1346 if (!reader_->ReadBytes(&range_length, PACKET_1BYTE_SEQUENCE_NUMBER)) {
1347 set_detailed_error("Unable to read missing sequence number range."); 1347 set_detailed_error("Unable to read missing sequence number range.");
1348 return false; 1348 return false;
1349 } 1349 }
1350 for (size_t i = 0; i <= range_length; ++i) { 1350 for (size_t j = 0; j <= range_length; ++j) {
1351 ack_frame->missing_packets.insert(last_sequence_number - i); 1351 ack_frame->missing_packets.insert(last_sequence_number - j);
1352 } 1352 }
1353 // Subtract an extra 1 to ensure ranges are represented efficiently and 1353 // Subtract an extra 1 to ensure ranges are represented efficiently and
1354 // can't overlap by 1 sequence number. This allows a missing_delta of 0 1354 // can't overlap by 1 sequence number. This allows a missing_delta of 0
1355 // to represent an adjacent nack range. 1355 // to represent an adjacent nack range.
1356 last_sequence_number -= (range_length + 1); 1356 last_sequence_number -= (range_length + 1);
1357 } 1357 }
1358 1358
1359 // Parse the revived packets list. 1359 // Parse the revived packets list.
1360 uint8 num_revived_packets; 1360 uint8 num_revived_packets;
1361 if (!reader_->ReadBytes(&num_revived_packets, 1)) { 1361 if (!reader_->ReadBytes(&num_revived_packets, 1)) {
(...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after
2092 2092
2093 if (delta_from_largest_observed > numeric_limits<uint8>::max()) { 2093 if (delta_from_largest_observed > numeric_limits<uint8>::max()) {
2094 return false; 2094 return false;
2095 } 2095 }
2096 2096
2097 if (!writer->WriteUInt8( 2097 if (!writer->WriteUInt8(
2098 delta_from_largest_observed & k1ByteSequenceNumberMask)) { 2098 delta_from_largest_observed & k1ByteSequenceNumberMask)) {
2099 return false; 2099 return false;
2100 } 2100 }
2101 2101
2102 uint64 time_delta_us = it->second.Subtract(prev_time).ToMicroseconds(); 2102 uint64 frame_time_delta_us =
2103 it->second.Subtract(prev_time).ToMicroseconds();
2103 prev_time = it->second; 2104 prev_time = it->second;
2104 if (!writer->WriteUFloat16(time_delta_us)) { 2105 if (!writer->WriteUFloat16(frame_time_delta_us)) {
2105 return false; 2106 return false;
2106 } 2107 }
2107 } 2108 }
2108 return true; 2109 return true;
2109 } 2110 }
2110 2111
2111 bool QuicFramer::AppendStopWaitingFrame( 2112 bool QuicFramer::AppendStopWaitingFrame(
2112 const QuicPacketHeader& header, 2113 const QuicPacketHeader& header,
2113 const QuicStopWaitingFrame& frame, 2114 const QuicStopWaitingFrame& frame,
2114 QuicDataWriter* writer) { 2115 QuicDataWriter* writer) {
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
2213 2214
2214 bool QuicFramer::RaiseError(QuicErrorCode error) { 2215 bool QuicFramer::RaiseError(QuicErrorCode error) {
2215 DVLOG(1) << "Error detail: " << detailed_error_; 2216 DVLOG(1) << "Error detail: " << detailed_error_;
2216 set_error(error); 2217 set_error(error);
2217 visitor_->OnError(this); 2218 visitor_->OnError(this);
2218 reader_.reset(nullptr); 2219 reader_.reset(nullptr);
2219 return false; 2220 return false;
2220 } 2221 }
2221 2222
2222 } // namespace net 2223 } // namespace net
OLDNEW
« net/quic/crypto/strike_register.cc ('K') | « net/quic/crypto/strike_register.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698