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

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

Issue 2535283002: Move QuicVersionManager into standalone .h/.cc. No behavior change. (Closed)
Patch Set: Rebase Created 4 years 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/core/quic_protocol.h ('k') | net/quic/core/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/core/quic_protocol.h" 5 #include "net/quic/core/quic_protocol.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_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 645 matching lines...) Expand 10 before | Expand all | Expand 10 after
656 } 656 }
657 657
658 StringPiece QuicPacket::Plaintext(QuicVersion version) const { 658 StringPiece QuicPacket::Plaintext(QuicVersion version) const {
659 const size_t start_of_encrypted_data = GetStartOfEncryptedData( 659 const size_t start_of_encrypted_data = GetStartOfEncryptedData(
660 version, connection_id_length_, includes_version_, includes_path_id_, 660 version, connection_id_length_, includes_version_, includes_path_id_,
661 includes_diversification_nonce_, packet_number_length_); 661 includes_diversification_nonce_, packet_number_length_);
662 return StringPiece(data() + start_of_encrypted_data, 662 return StringPiece(data() + start_of_encrypted_data,
663 length() - start_of_encrypted_data); 663 length() - start_of_encrypted_data);
664 } 664 }
665 665
666 QuicVersionManager::QuicVersionManager(QuicVersionVector supported_versions)
667 : enable_version_36_(FLAGS_quic_enable_version_36_v3),
668 allowed_supported_versions_(supported_versions),
669 filtered_supported_versions_(
670 FilterSupportedVersions(supported_versions)) {}
671
672 QuicVersionManager::~QuicVersionManager() {}
673
674 const QuicVersionVector& QuicVersionManager::GetSupportedVersions() {
675 MaybeRefilterSupportedVersions();
676 return filtered_supported_versions_;
677 }
678
679 void QuicVersionManager::MaybeRefilterSupportedVersions() {
680 if (enable_version_36_ != FLAGS_quic_enable_version_36_v3) {
681 enable_version_36_ = FLAGS_quic_enable_version_36_v3;
682 RefilterSupportedVersions();
683 }
684 }
685
686 void QuicVersionManager::RefilterSupportedVersions() {
687 filtered_supported_versions_ =
688 FilterSupportedVersions(allowed_supported_versions_);
689 }
690
691 AckListenerWrapper::AckListenerWrapper(QuicAckListenerInterface* listener, 666 AckListenerWrapper::AckListenerWrapper(QuicAckListenerInterface* listener,
692 QuicPacketLength data_length) 667 QuicPacketLength data_length)
693 : ack_listener(listener), length(data_length) { 668 : ack_listener(listener), length(data_length) {
694 DCHECK(listener != nullptr); 669 DCHECK(listener != nullptr);
695 } 670 }
696 671
697 AckListenerWrapper::AckListenerWrapper(const AckListenerWrapper& other) = 672 AckListenerWrapper::AckListenerWrapper(const AckListenerWrapper& other) =
698 default; 673 default;
699 674
700 AckListenerWrapper::~AckListenerWrapper() {} 675 AckListenerWrapper::~AckListenerWrapper() {}
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
766 is_unackable(false), 741 is_unackable(false),
767 has_crypto_handshake(has_crypto_handshake), 742 has_crypto_handshake(has_crypto_handshake),
768 num_padding_bytes(num_padding_bytes), 743 num_padding_bytes(num_padding_bytes),
769 retransmission(0) {} 744 retransmission(0) {}
770 745
771 TransmissionInfo::TransmissionInfo(const TransmissionInfo& other) = default; 746 TransmissionInfo::TransmissionInfo(const TransmissionInfo& other) = default;
772 747
773 TransmissionInfo::~TransmissionInfo() {} 748 TransmissionInfo::~TransmissionInfo() {}
774 749
775 } // namespace net 750 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/core/quic_protocol.h ('k') | net/quic/core/quic_protocol_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698