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_39_(base::GetFlag(FLAGS_quic_enable_version_39)), | 13 : enable_version_39_(base::GetFlag(FLAGS_quic_enable_version_39)), |
14 enable_version_38_(FLAGS_quic_reloadable_flag_quic_enable_version_38), | 14 enable_version_38_(FLAGS_quic_reloadable_flag_quic_enable_version_38), |
15 enable_version_37_(FLAGS_quic_reloadable_flag_quic_enable_version_37), | 15 enable_version_37_(FLAGS_quic_reloadable_flag_quic_enable_version_37), |
16 enable_version_36_(FLAGS_quic_reloadable_flag_quic_enable_version_36_v3), | 16 enable_version_36_(FLAGS_quic_reloadable_flag_quic_enable_version_36_v3), |
17 disable_version_34_(FLAGS_quic_reloadable_flag_quic_disable_version_34), | |
18 allowed_supported_versions_(supported_versions), | 17 allowed_supported_versions_(supported_versions), |
19 filtered_supported_versions_( | 18 filtered_supported_versions_( |
20 FilterSupportedVersions(supported_versions)) {} | 19 FilterSupportedVersions(supported_versions)) {} |
21 | 20 |
22 QuicVersionManager::~QuicVersionManager() {} | 21 QuicVersionManager::~QuicVersionManager() {} |
23 | 22 |
24 const QuicVersionVector& QuicVersionManager::GetSupportedVersions() { | 23 const QuicVersionVector& QuicVersionManager::GetSupportedVersions() { |
25 MaybeRefilterSupportedVersions(); | 24 MaybeRefilterSupportedVersions(); |
26 return filtered_supported_versions_; | 25 return filtered_supported_versions_; |
27 } | 26 } |
28 | 27 |
29 void QuicVersionManager::MaybeRefilterSupportedVersions() { | 28 void QuicVersionManager::MaybeRefilterSupportedVersions() { |
30 if (enable_version_39_ != base::GetFlag(FLAGS_quic_enable_version_39) || | 29 if (enable_version_39_ != base::GetFlag(FLAGS_quic_enable_version_39) || |
31 enable_version_38_ != FLAGS_quic_reloadable_flag_quic_enable_version_38 || | 30 enable_version_38_ != FLAGS_quic_reloadable_flag_quic_enable_version_38 || |
32 enable_version_37_ != FLAGS_quic_reloadable_flag_quic_enable_version_37 || | 31 enable_version_37_ != FLAGS_quic_reloadable_flag_quic_enable_version_37 || |
33 enable_version_36_ != | 32 enable_version_36_ != |
34 FLAGS_quic_reloadable_flag_quic_enable_version_36_v3 || | 33 FLAGS_quic_reloadable_flag_quic_enable_version_36_v3) { |
35 disable_version_34_ != | |
36 FLAGS_quic_reloadable_flag_quic_disable_version_34) { | |
37 enable_version_39_ = base::GetFlag(FLAGS_quic_enable_version_39); | 34 enable_version_39_ = base::GetFlag(FLAGS_quic_enable_version_39); |
38 enable_version_38_ = FLAGS_quic_reloadable_flag_quic_enable_version_38; | 35 enable_version_38_ = FLAGS_quic_reloadable_flag_quic_enable_version_38; |
39 enable_version_37_ = FLAGS_quic_reloadable_flag_quic_enable_version_37; | 36 enable_version_37_ = FLAGS_quic_reloadable_flag_quic_enable_version_37; |
40 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; |
41 disable_version_34_ = FLAGS_quic_reloadable_flag_quic_disable_version_34; | |
42 RefilterSupportedVersions(); | 38 RefilterSupportedVersions(); |
43 } | 39 } |
44 } | 40 } |
45 | 41 |
46 void QuicVersionManager::RefilterSupportedVersions() { | 42 void QuicVersionManager::RefilterSupportedVersions() { |
47 filtered_supported_versions_ = | 43 filtered_supported_versions_ = |
48 FilterSupportedVersions(allowed_supported_versions_); | 44 FilterSupportedVersions(allowed_supported_versions_); |
49 } | 45 } |
50 | 46 |
51 } // namespace net | 47 } // namespace net |
OLD | NEW |