summaryrefslogtreecommitdiff
path: root/chromium/net/quic/platform/impl/quic_test_flags_utils.h
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/net/quic/platform/impl/quic_test_flags_utils.h')
-rw-r--r--chromium/net/quic/platform/impl/quic_test_flags_utils.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/chromium/net/quic/platform/impl/quic_test_flags_utils.h b/chromium/net/quic/platform/impl/quic_test_flags_utils.h
new file mode 100644
index 00000000000..ff11a3ab9b9
--- /dev/null
+++ b/chromium/net/quic/platform/impl/quic_test_flags_utils.h
@@ -0,0 +1,30 @@
+// Copyright (c) 2021 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_PLATFORM_IMPL_QUIC_TEST_FLAGS_UTILS_H_
+#define NET_QUIC_PLATFORM_IMPL_QUIC_TEST_FLAGS_UTILS_H_
+
+// When constructed, saves the current values of all QUIC flags. When
+// destructed, restores all QUIC flags to the saved values.
+class QuicFlagSaverImpl {
+ public:
+ QuicFlagSaverImpl();
+ ~QuicFlagSaverImpl();
+
+ private:
+#define QUIC_FLAG(flag, value) bool saved_##flag##_;
+#include "net/third_party/quiche/src/quic/core/quic_flags_list.h"
+#undef QUIC_FLAG
+#define QUIC_PROTOCOL_FLAG(type, flag, ...) type saved_##flag##_;
+#include "net/third_party/quiche/src/quic/core/quic_protocol_flags_list.h"
+#undef QUIC_PROTOCOL_FLAG
+};
+
+//// Checks if all QUIC flags are on their default values on construction.
+class QuicFlagChecker {
+ public:
+ QuicFlagChecker();
+};
+
+#endif // NET_QUIC_PLATFORM_IMPL_QUIC_TEST_FLAGS_UTILS_H_