OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "net/quic/core/quic_version_manager.h" |
| 6 |
| 7 #include "net/quic/core/quic_flags.h" |
| 8 #include "net/quic/core/quic_versions.h" |
| 9 |
| 10 namespace net { |
| 11 |
| 12 QuicVersionManager::QuicVersionManager(QuicVersionVector supported_versions) |
| 13 : enable_version_36_(FLAGS_quic_enable_version_36_v3), |
| 14 allowed_supported_versions_(supported_versions), |
| 15 filtered_supported_versions_( |
| 16 FilterSupportedVersions(supported_versions)) {} |
| 17 |
| 18 QuicVersionManager::~QuicVersionManager() {} |
| 19 |
| 20 const QuicVersionVector& QuicVersionManager::GetSupportedVersions() { |
| 21 MaybeRefilterSupportedVersions(); |
| 22 return filtered_supported_versions_; |
| 23 } |
| 24 |
| 25 void QuicVersionManager::MaybeRefilterSupportedVersions() { |
| 26 if (enable_version_36_ != FLAGS_quic_enable_version_36_v3) { |
| 27 enable_version_36_ = FLAGS_quic_enable_version_36_v3; |
| 28 RefilterSupportedVersions(); |
| 29 } |
| 30 } |
| 31 |
| 32 void QuicVersionManager::RefilterSupportedVersions() { |
| 33 filtered_supported_versions_ = |
| 34 FilterSupportedVersions(allowed_supported_versions_); |
| 35 } |
| 36 |
| 37 } // namespace net |
OLD | NEW |