Index: net/quic/core/quic_version_manager.h |
diff --git a/net/quic/core/quic_version_manager.h b/net/quic/core/quic_version_manager.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..cd8e9f95373f05ccfc27f3ec0b78a6c1793ed875 |
--- /dev/null |
+++ b/net/quic/core/quic_version_manager.h |
@@ -0,0 +1,44 @@ |
+// Copyright (c) 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef NET_QUIC_CORE_QUIC_VERSION_MANAGER_H_ |
+#define NET_QUIC_CORE_QUIC_VERSION_MANAGER_H_ |
+ |
+#include "net/quic/core/quic_versions.h" |
+ |
+namespace net { |
+ |
+// Used to generate filtered supported versions based on flags. |
+class NET_EXPORT_PRIVATE QuicVersionManager { |
+ public: |
+ explicit QuicVersionManager(QuicVersionVector supported_versions); |
+ virtual ~QuicVersionManager(); |
+ |
+ // Returns currently supported QUIC versions. |
+ const QuicVersionVector& GetSupportedVersions(); |
+ |
+ protected: |
+ // Maybe refilter filtered_supported_versions_ based on flags. |
+ void MaybeRefilterSupportedVersions(); |
+ |
+ // Refilters filtered_supported_versions_. |
+ virtual void RefilterSupportedVersions(); |
+ |
+ const QuicVersionVector& filtered_supported_versions() const { |
+ return filtered_supported_versions_; |
+ } |
+ |
+ private: |
+ // FLAGS_quic_enable_version_36_v3 |
+ bool enable_version_36_; |
+ // The list of versions that may be supported. |
+ QuicVersionVector allowed_supported_versions_; |
+ // This vector contains QUIC versions which are currently supported based on |
+ // flags. |
+ QuicVersionVector filtered_supported_versions_; |
+}; |
+ |
+} // namespace net |
+ |
+#endif // NET_QUIC_CORE_QUIC_VERSION_MANAGER_H_ |