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

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

Issue 1785513003: Simplify QUIC's encryption path now that FEC is gone. Protected by FLAG_quic_inplace_encryption. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@116261116
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « net/quic/quic_protocol.h ('k') | 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_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 "net/quic/quic_flags.h" 8 #include "net/quic/quic_flags.h"
9 #include "net/quic/quic_utils.h" 9 #include "net/quic/quic_utils.h"
10 10
(...skipping 17 matching lines...) Expand all
28 size_t GetPacketHeaderSize(QuicConnectionIdLength connection_id_length, 28 size_t GetPacketHeaderSize(QuicConnectionIdLength connection_id_length,
29 bool include_version, 29 bool include_version,
30 bool include_path_id, 30 bool include_path_id,
31 QuicPacketNumberLength packet_number_length) { 31 QuicPacketNumberLength packet_number_length) {
32 return kPublicFlagsSize + connection_id_length + 32 return kPublicFlagsSize + connection_id_length +
33 (include_version ? kQuicVersionSize : 0) + 33 (include_version ? kQuicVersionSize : 0) +
34 (include_path_id ? kQuicPathIdSize : 0) + packet_number_length + 34 (include_path_id ? kQuicPathIdSize : 0) + packet_number_length +
35 kPrivateFlagsSize; 35 kPrivateFlagsSize;
36 } 36 }
37 37
38 size_t GetStartOfEncryptedData(const QuicPacketHeader& header) {
39 return GetPacketHeaderSize(header) - kPrivateFlagsSize;
40 }
41
38 size_t GetStartOfEncryptedData(QuicConnectionIdLength connection_id_length, 42 size_t GetStartOfEncryptedData(QuicConnectionIdLength connection_id_length,
39 bool include_version, 43 bool include_version,
40 bool include_path_id, 44 bool include_path_id,
41 QuicPacketNumberLength packet_number_length) { 45 QuicPacketNumberLength packet_number_length) {
42 // Don't include the fec size, since encryption starts before private flags. 46 // Don't include the fec size, since encryption starts before private flags.
43 return GetPacketHeaderSize(connection_id_length, include_version, 47 return GetPacketHeaderSize(connection_id_length, include_version,
44 include_path_id, packet_number_length) - 48 include_path_id, packet_number_length) -
45 kPrivateFlagsSize; 49 kPrivateFlagsSize;
46 } 50 }
47 51
(...skipping 738 matching lines...) Expand 10 before | Expand all | Expand 10 after
786 is_fec_packet(is_fec_packet), 790 is_fec_packet(is_fec_packet),
787 has_crypto_handshake(has_crypto_handshake), 791 has_crypto_handshake(has_crypto_handshake),
788 needs_padding(needs_padding), 792 needs_padding(needs_padding),
789 retransmission(0) {} 793 retransmission(0) {}
790 794
791 TransmissionInfo::TransmissionInfo(const TransmissionInfo& other) = default; 795 TransmissionInfo::TransmissionInfo(const TransmissionInfo& other) = default;
792 796
793 TransmissionInfo::~TransmissionInfo() {} 797 TransmissionInfo::~TransmissionInfo() {}
794 798
795 } // namespace net 799 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_protocol.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698