OLD | NEW |
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/core/quic_protocol.h" | 5 #include "net/quic/core/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/core/quic_flags.h" | 9 #include "net/quic/core/quic_flags.h" |
10 #include "net/quic/core/quic_utils.h" | 10 #include "net/quic/core/quic_utils.h" |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 | 185 |
186 QuicVersionVector FilterSupportedVersions(QuicVersionVector versions) { | 186 QuicVersionVector FilterSupportedVersions(QuicVersionVector versions) { |
187 QuicVersionVector filtered_versions(versions.size()); | 187 QuicVersionVector filtered_versions(versions.size()); |
188 filtered_versions.clear(); // Guaranteed by spec not to change capacity. | 188 filtered_versions.clear(); // Guaranteed by spec not to change capacity. |
189 for (QuicVersion version : versions) { | 189 for (QuicVersion version : versions) { |
190 if (version == QUIC_VERSION_35) { | 190 if (version == QUIC_VERSION_35) { |
191 if (FLAGS_quic_enable_version_35) { | 191 if (FLAGS_quic_enable_version_35) { |
192 filtered_versions.push_back(version); | 192 filtered_versions.push_back(version); |
193 } | 193 } |
194 } else if (version == QUIC_VERSION_36) { | 194 } else if (version == QUIC_VERSION_36) { |
195 if (FLAGS_quic_enable_version_35 && FLAGS_quic_enable_version_36) { | 195 if (FLAGS_quic_enable_version_35 && FLAGS_quic_enable_version_36_v2) { |
196 filtered_versions.push_back(version); | 196 filtered_versions.push_back(version); |
197 } | 197 } |
198 } else { | 198 } else { |
199 filtered_versions.push_back(version); | 199 filtered_versions.push_back(version); |
200 } | 200 } |
201 } | 201 } |
202 return filtered_versions; | 202 return filtered_versions; |
203 } | 203 } |
204 | 204 |
205 QuicVersionVector VersionOfIndex(const QuicVersionVector& versions, int index) { | 205 QuicVersionVector VersionOfIndex(const QuicVersionVector& versions, int index) { |
(...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
843 StringPiece QuicPacket::Plaintext(QuicVersion version) const { | 843 StringPiece QuicPacket::Plaintext(QuicVersion version) const { |
844 const size_t start_of_encrypted_data = GetStartOfEncryptedData( | 844 const size_t start_of_encrypted_data = GetStartOfEncryptedData( |
845 version, connection_id_length_, includes_version_, includes_path_id_, | 845 version, connection_id_length_, includes_version_, includes_path_id_, |
846 includes_diversification_nonce_, packet_number_length_); | 846 includes_diversification_nonce_, packet_number_length_); |
847 return StringPiece(data() + start_of_encrypted_data, | 847 return StringPiece(data() + start_of_encrypted_data, |
848 length() - start_of_encrypted_data); | 848 length() - start_of_encrypted_data); |
849 } | 849 } |
850 | 850 |
851 QuicVersionManager::QuicVersionManager(QuicVersionVector supported_versions) | 851 QuicVersionManager::QuicVersionManager(QuicVersionVector supported_versions) |
852 : enable_quic_version_35_(FLAGS_quic_enable_version_35), | 852 : enable_quic_version_35_(FLAGS_quic_enable_version_35), |
853 enable_quic_version_36_(FLAGS_quic_enable_version_36), | 853 enable_quic_version_36_(FLAGS_quic_enable_version_36_v2), |
854 allowed_supported_versions_(supported_versions), | 854 allowed_supported_versions_(supported_versions), |
855 filtered_supported_versions_( | 855 filtered_supported_versions_( |
856 FilterSupportedVersions(supported_versions)) {} | 856 FilterSupportedVersions(supported_versions)) {} |
857 | 857 |
858 const QuicVersionVector& QuicVersionManager::GetSupportedVersions() { | 858 const QuicVersionVector& QuicVersionManager::GetSupportedVersions() { |
859 if (enable_quic_version_35_ != FLAGS_quic_enable_version_35 || | 859 if (enable_quic_version_35_ != FLAGS_quic_enable_version_35 || |
860 enable_quic_version_36_ != FLAGS_quic_enable_version_36) { | 860 enable_quic_version_36_ != FLAGS_quic_enable_version_36_v2) { |
861 enable_quic_version_35_ = FLAGS_quic_enable_version_35; | 861 enable_quic_version_35_ = FLAGS_quic_enable_version_35; |
862 enable_quic_version_36_ = FLAGS_quic_enable_version_36; | 862 enable_quic_version_36_ = FLAGS_quic_enable_version_36_v2; |
863 filtered_supported_versions_ = | 863 filtered_supported_versions_ = |
864 FilterSupportedVersions(allowed_supported_versions_); | 864 FilterSupportedVersions(allowed_supported_versions_); |
865 } | 865 } |
866 return filtered_supported_versions_; | 866 return filtered_supported_versions_; |
867 } | 867 } |
868 | 868 |
869 QuicVersionManager::~QuicVersionManager() {} | 869 QuicVersionManager::~QuicVersionManager() {} |
870 | 870 |
871 AckListenerWrapper::AckListenerWrapper(QuicAckListenerInterface* listener, | 871 AckListenerWrapper::AckListenerWrapper(QuicAckListenerInterface* listener, |
872 QuicPacketLength data_length) | 872 QuicPacketLength data_length) |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
934 is_unackable(false), | 934 is_unackable(false), |
935 has_crypto_handshake(has_crypto_handshake), | 935 has_crypto_handshake(has_crypto_handshake), |
936 num_padding_bytes(num_padding_bytes), | 936 num_padding_bytes(num_padding_bytes), |
937 retransmission(0) {} | 937 retransmission(0) {} |
938 | 938 |
939 TransmissionInfo::TransmissionInfo(const TransmissionInfo& other) = default; | 939 TransmissionInfo::TransmissionInfo(const TransmissionInfo& other) = default; |
940 | 940 |
941 TransmissionInfo::~TransmissionInfo() {} | 941 TransmissionInfo::~TransmissionInfo() {} |
942 | 942 |
943 } // namespace net | 943 } // namespace net |
OLD | NEW |