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

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

Issue 2182723002: Remove redundant vector::reserve in QuicFramer::ProcessTimestampsInAckFrame. No functional change. … (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@128162214
Patch Set: Created 4 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <cstdint> 7 #include <cstdint>
8 #include <memory> 8 #include <memory>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 1556 matching lines...) Expand 10 before | Expand all | Expand 10 after
1567 if (ack_frame->is_truncated) { 1567 if (ack_frame->is_truncated) {
1568 return true; 1568 return true;
1569 } 1569 }
1570 uint8_t num_received_packets; 1570 uint8_t num_received_packets;
1571 if (!reader->ReadBytes(&num_received_packets, 1)) { 1571 if (!reader->ReadBytes(&num_received_packets, 1)) {
1572 set_detailed_error("Unable to read num received packets."); 1572 set_detailed_error("Unable to read num received packets.");
1573 return false; 1573 return false;
1574 } 1574 }
1575 1575
1576 if (num_received_packets > 0) { 1576 if (num_received_packets > 0) {
1577 ack_frame->received_packet_times.reserve(num_received_packets);
1578 uint8_t delta_from_largest_observed; 1577 uint8_t delta_from_largest_observed;
1579 if (!reader->ReadBytes(&delta_from_largest_observed, 1578 if (!reader->ReadBytes(&delta_from_largest_observed,
1580 PACKET_1BYTE_PACKET_NUMBER)) { 1579 PACKET_1BYTE_PACKET_NUMBER)) {
1581 set_detailed_error("Unable to read sequence delta in received packets."); 1580 set_detailed_error("Unable to read sequence delta in received packets.");
1582 return false; 1581 return false;
1583 } 1582 }
1584 QuicPacketNumber seq_num = 1583 QuicPacketNumber seq_num =
1585 ack_frame->largest_observed - delta_from_largest_observed; 1584 ack_frame->largest_observed - delta_from_largest_observed;
1586 1585
1587 // Time delta from the framer creation. 1586 // Time delta from the framer creation.
(...skipping 1002 matching lines...) Expand 10 before | Expand all | Expand 10 after
2590 2589
2591 bool QuicFramer::RaiseError(QuicErrorCode error) { 2590 bool QuicFramer::RaiseError(QuicErrorCode error) {
2592 DVLOG(1) << "Error: " << QuicUtils::ErrorToString(error) 2591 DVLOG(1) << "Error: " << QuicUtils::ErrorToString(error)
2593 << " detail: " << detailed_error_; 2592 << " detail: " << detailed_error_;
2594 set_error(error); 2593 set_error(error);
2595 visitor_->OnError(this); 2594 visitor_->OnError(this);
2596 return false; 2595 return false;
2597 } 2596 }
2598 2597
2599 } // namespace net 2598 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698