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

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

Issue 2011653004: Remove obsolete fields in quic_protocol and their current usage in QUIC. Reorders QuicAckFrame fie… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@122721477
Patch Set: Created 4 years, 6 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 | « net/quic/quic_protocol.h ('k') | net/quic/quic_protocol_test.cc » ('j') | 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_protocol.h" 5 #include "net/quic/quic_protocol.h"
6 6
7 #include "base/stl_util.h" 7 #include "base/stl_util.h"
8 #include "base/strings/string_number_conversions.h" 8 #include "base/strings/string_number_conversions.h"
9 #include "net/quic/quic_flags.h" 9 #include "net/quic/quic_flags.h"
10 #include "net/quic/quic_utils.h" 10 #include "net/quic/quic_utils.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 QuicPacketPublicHeader::QuicPacketPublicHeader( 72 QuicPacketPublicHeader::QuicPacketPublicHeader(
73 const QuicPacketPublicHeader& other) = default; 73 const QuicPacketPublicHeader& other) = default;
74 74
75 QuicPacketPublicHeader::~QuicPacketPublicHeader() {} 75 QuicPacketPublicHeader::~QuicPacketPublicHeader() {}
76 76
77 QuicPacketHeader::QuicPacketHeader() 77 QuicPacketHeader::QuicPacketHeader()
78 : packet_number(0), 78 : packet_number(0),
79 path_id(kDefaultPathId), 79 path_id(kDefaultPathId),
80 entropy_flag(false), 80 entropy_flag(false),
81 entropy_hash(0), 81 entropy_hash(0),
82 fec_flag(false), 82 fec_flag(false) {}
83 is_in_fec_group(NOT_IN_FEC_GROUP),
84 fec_group(0) {}
85 83
86 QuicPacketHeader::QuicPacketHeader(const QuicPacketPublicHeader& header) 84 QuicPacketHeader::QuicPacketHeader(const QuicPacketPublicHeader& header)
87 : public_header(header), 85 : public_header(header),
88 packet_number(0), 86 packet_number(0),
89 path_id(kDefaultPathId), 87 path_id(kDefaultPathId),
90 entropy_flag(false), 88 entropy_flag(false),
91 entropy_hash(0), 89 entropy_hash(0),
92 fec_flag(false), 90 fec_flag(false) {}
93 is_in_fec_group(NOT_IN_FEC_GROUP),
94 fec_group(0) {}
95 91
96 QuicPacketHeader::QuicPacketHeader(const QuicPacketHeader& other) = default; 92 QuicPacketHeader::QuicPacketHeader(const QuicPacketHeader& other) = default;
97 93
98 QuicPublicResetPacket::QuicPublicResetPacket() 94 QuicPublicResetPacket::QuicPublicResetPacket()
99 : nonce_proof(0), rejected_packet_number(0) {} 95 : nonce_proof(0), rejected_packet_number(0) {}
100 96
101 QuicPublicResetPacket::QuicPublicResetPacket( 97 QuicPublicResetPacket::QuicPublicResetPacket(
102 const QuicPacketPublicHeader& header) 98 const QuicPacketPublicHeader& header)
103 : public_header(header), nonce_proof(0), rejected_packet_number(0) {} 99 : public_header(header), nonce_proof(0), rejected_packet_number(0) {}
104 100
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 } 277 }
282 } 278 }
283 if (header.public_header.nonce != nullptr) { 279 if (header.public_header.nonce != nullptr) {
284 os << ", diversification_nonce: " 280 os << ", diversification_nonce: "
285 << net::QuicUtils::HexDecode(*header.public_header.nonce); 281 << net::QuicUtils::HexDecode(*header.public_header.nonce);
286 } 282 }
287 os << ", fec_flag: " << header.fec_flag 283 os << ", fec_flag: " << header.fec_flag
288 << ", entropy_flag: " << header.entropy_flag 284 << ", entropy_flag: " << header.entropy_flag
289 << ", entropy hash: " << static_cast<int>(header.entropy_hash) 285 << ", entropy hash: " << static_cast<int>(header.entropy_hash)
290 << ", path_id: " << static_cast<int>(header.path_id) 286 << ", path_id: " << static_cast<int>(header.path_id)
291 << ", packet_number: " << header.packet_number 287 << ", packet_number: " << header.packet_number << " }\n";
292 << ", is_in_fec_group: " << header.is_in_fec_group
293 << ", fec_group: " << header.fec_group << " }\n";
294 return os; 288 return os;
295 } 289 }
296 290
297 bool IsAwaitingPacket(const QuicAckFrame& ack_frame, 291 bool IsAwaitingPacket(const QuicAckFrame& ack_frame,
298 QuicPacketNumber packet_number, 292 QuicPacketNumber packet_number,
299 QuicPacketNumber peer_least_packet_awaiting_ack) { 293 QuicPacketNumber peer_least_packet_awaiting_ack) {
300 if (ack_frame.missing) { 294 if (ack_frame.missing) {
301 return packet_number > ack_frame.largest_observed || 295 return packet_number > ack_frame.largest_observed ||
302 ack_frame.packets.Contains(packet_number); 296 ack_frame.packets.Contains(packet_number);
303 } 297 }
304 return packet_number >= peer_least_packet_awaiting_ack && 298 return packet_number >= peer_least_packet_awaiting_ack &&
305 !ack_frame.packets.Contains(packet_number); 299 !ack_frame.packets.Contains(packet_number);
306 } 300 }
307 301
308 QuicStopWaitingFrame::QuicStopWaitingFrame() 302 QuicStopWaitingFrame::QuicStopWaitingFrame()
309 : path_id(kDefaultPathId), entropy_hash(0), least_unacked(0) {} 303 : path_id(kDefaultPathId), entropy_hash(0), least_unacked(0) {}
310 304
311 QuicStopWaitingFrame::~QuicStopWaitingFrame() {} 305 QuicStopWaitingFrame::~QuicStopWaitingFrame() {}
312 306
313 QuicAckFrame::QuicAckFrame() 307 QuicAckFrame::QuicAckFrame()
314 : path_id(kDefaultPathId), 308 : largest_observed(0),
309 ack_delay_time(QuicTime::Delta::Infinite()),
310 path_id(kDefaultPathId),
315 entropy_hash(0), 311 entropy_hash(0),
316 is_truncated(false), 312 is_truncated(false),
317 largest_observed(0),
318 ack_delay_time(QuicTime::Delta::Infinite()),
319 missing(true) {} 313 missing(true) {}
320 314
321 QuicAckFrame::QuicAckFrame(const QuicAckFrame& other) = default; 315 QuicAckFrame::QuicAckFrame(const QuicAckFrame& other) = default;
322 316
323 QuicAckFrame::~QuicAckFrame() {} 317 QuicAckFrame::~QuicAckFrame() {}
324 318
325 QuicRstStreamErrorCode AdjustErrorForVersion(QuicRstStreamErrorCode error_code, 319 QuicRstStreamErrorCode AdjustErrorForVersion(QuicRstStreamErrorCode error_code,
326 QuicVersion /*version*/) { 320 QuicVersion /*version*/) {
327 return error_code; 321 return error_code;
328 } 322 }
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after
811 encrypted_length(encrypted_length), 805 encrypted_length(encrypted_length),
812 has_crypto_handshake(NOT_HANDSHAKE), 806 has_crypto_handshake(NOT_HANDSHAKE),
813 num_padding_bytes(0), 807 num_padding_bytes(0),
814 path_id(path_id), 808 path_id(path_id),
815 packet_number(packet_number), 809 packet_number(packet_number),
816 packet_number_length(packet_number_length), 810 packet_number_length(packet_number_length),
817 encryption_level(ENCRYPTION_NONE), 811 encryption_level(ENCRYPTION_NONE),
818 entropy_hash(entropy_hash), 812 entropy_hash(entropy_hash),
819 has_ack(has_ack), 813 has_ack(has_ack),
820 has_stop_waiting(has_stop_waiting), 814 has_stop_waiting(has_stop_waiting),
815 transmission_type(NOT_RETRANSMISSION),
821 original_path_id(kInvalidPathId), 816 original_path_id(kInvalidPathId),
822 original_packet_number(0), 817 original_packet_number(0) {}
823 transmission_type(NOT_RETRANSMISSION) {}
824 818
825 SerializedPacket::SerializedPacket(const SerializedPacket& other) = default; 819 SerializedPacket::SerializedPacket(const SerializedPacket& other) = default;
826 820
827 SerializedPacket::~SerializedPacket() {} 821 SerializedPacket::~SerializedPacket() {}
828 822
829 TransmissionInfo::TransmissionInfo() 823 TransmissionInfo::TransmissionInfo()
830 : encryption_level(ENCRYPTION_NONE), 824 : encryption_level(ENCRYPTION_NONE),
831 packet_number_length(PACKET_1BYTE_PACKET_NUMBER), 825 packet_number_length(PACKET_1BYTE_PACKET_NUMBER),
832 bytes_sent(0), 826 bytes_sent(0),
833 sent_time(QuicTime::Zero()), 827 sent_time(QuicTime::Zero()),
(...skipping 20 matching lines...) Expand all
854 is_unackable(false), 848 is_unackable(false),
855 has_crypto_handshake(has_crypto_handshake), 849 has_crypto_handshake(has_crypto_handshake),
856 num_padding_bytes(num_padding_bytes), 850 num_padding_bytes(num_padding_bytes),
857 retransmission(0) {} 851 retransmission(0) {}
858 852
859 TransmissionInfo::TransmissionInfo(const TransmissionInfo& other) = default; 853 TransmissionInfo::TransmissionInfo(const TransmissionInfo& other) = default;
860 854
861 TransmissionInfo::~TransmissionInfo() {} 855 TransmissionInfo::~TransmissionInfo() {}
862 856
863 } // namespace net 857 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_protocol.h ('k') | net/quic/quic_protocol_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698