OLD | NEW |
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 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 | 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_version_manager.h" | 5 #include "net/quic/core/quic_version_manager.h" |
6 | 6 |
7 #include "net/quic/core/quic_flags.h" | 7 #include "net/quic/core/quic_flags.h" |
8 #include "net/quic/core/quic_versions.h" | 8 #include "net/quic/core/quic_versions.h" |
9 | 9 |
10 namespace net { | 10 namespace net { |
11 | 11 |
12 QuicVersionManager::QuicVersionManager(QuicVersionVector supported_versions) | 12 QuicVersionManager::QuicVersionManager(QuicVersionVector supported_versions) |
13 : enable_version_38_(FLAGS_quic_enable_version_38), | 13 : enable_version_38_(FLAGS_quic_reloadable_flag_quic_enable_version_38), |
14 enable_version_37_(FLAGS_quic_reloadable_flag_quic_enable_version_37), | 14 enable_version_37_(FLAGS_quic_reloadable_flag_quic_enable_version_37), |
15 enable_version_36_(FLAGS_quic_reloadable_flag_quic_enable_version_36_v3), | 15 enable_version_36_(FLAGS_quic_reloadable_flag_quic_enable_version_36_v3), |
16 disable_version_34_(FLAGS_quic_reloadable_flag_quic_disable_version_34), | 16 disable_version_34_(FLAGS_quic_reloadable_flag_quic_disable_version_34), |
17 allowed_supported_versions_(supported_versions), | 17 allowed_supported_versions_(supported_versions), |
18 filtered_supported_versions_( | 18 filtered_supported_versions_( |
19 FilterSupportedVersions(supported_versions)) {} | 19 FilterSupportedVersions(supported_versions)) {} |
20 | 20 |
21 QuicVersionManager::~QuicVersionManager() {} | 21 QuicVersionManager::~QuicVersionManager() {} |
22 | 22 |
23 const QuicVersionVector& QuicVersionManager::GetSupportedVersions() { | 23 const QuicVersionVector& QuicVersionManager::GetSupportedVersions() { |
24 MaybeRefilterSupportedVersions(); | 24 MaybeRefilterSupportedVersions(); |
25 return filtered_supported_versions_; | 25 return filtered_supported_versions_; |
26 } | 26 } |
27 | 27 |
28 void QuicVersionManager::MaybeRefilterSupportedVersions() { | 28 void QuicVersionManager::MaybeRefilterSupportedVersions() { |
29 if (enable_version_38_ != FLAGS_quic_enable_version_38 || | 29 if (enable_version_38_ != FLAGS_quic_reloadable_flag_quic_enable_version_38 || |
30 enable_version_37_ != FLAGS_quic_reloadable_flag_quic_enable_version_37 || | 30 enable_version_37_ != FLAGS_quic_reloadable_flag_quic_enable_version_37 || |
31 enable_version_36_ != | 31 enable_version_36_ != |
32 FLAGS_quic_reloadable_flag_quic_enable_version_36_v3 || | 32 FLAGS_quic_reloadable_flag_quic_enable_version_36_v3 || |
33 disable_version_34_ != | 33 disable_version_34_ != |
34 FLAGS_quic_reloadable_flag_quic_disable_version_34) { | 34 FLAGS_quic_reloadable_flag_quic_disable_version_34) { |
35 enable_version_38_ = FLAGS_quic_enable_version_38; | 35 enable_version_38_ = FLAGS_quic_reloadable_flag_quic_enable_version_38; |
36 enable_version_37_ = FLAGS_quic_reloadable_flag_quic_enable_version_37; | 36 enable_version_37_ = FLAGS_quic_reloadable_flag_quic_enable_version_37; |
37 enable_version_36_ = FLAGS_quic_reloadable_flag_quic_enable_version_36_v3; | 37 enable_version_36_ = FLAGS_quic_reloadable_flag_quic_enable_version_36_v3; |
38 disable_version_34_ = FLAGS_quic_reloadable_flag_quic_disable_version_34; | 38 disable_version_34_ = FLAGS_quic_reloadable_flag_quic_disable_version_34; |
39 RefilterSupportedVersions(); | 39 RefilterSupportedVersions(); |
40 } | 40 } |
41 } | 41 } |
42 | 42 |
43 void QuicVersionManager::RefilterSupportedVersions() { | 43 void QuicVersionManager::RefilterSupportedVersions() { |
44 filtered_supported_versions_ = | 44 filtered_supported_versions_ = |
45 FilterSupportedVersions(allowed_supported_versions_); | 45 FilterSupportedVersions(allowed_supported_versions_); |
46 } | 46 } |
47 | 47 |
48 } // namespace net | 48 } // namespace net |
OLD | NEW |