xref: /aosp_15_r20/external/cronet/net/quic/platform/impl/quic_test_flags_utils.h (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1 // Copyright 2021 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef NET_QUIC_PLATFORM_IMPL_QUIC_TEST_FLAGS_UTILS_H_
6 #define NET_QUIC_PLATFORM_IMPL_QUIC_TEST_FLAGS_UTILS_H_
7 
8 // When constructed, saves the current values of all QUIC flags. When
9 // destructed, restores all QUIC flags to the saved values.
10 class QuicFlagSaverImpl {
11  public:
12   QuicFlagSaverImpl();
13   ~QuicFlagSaverImpl();
14 
15  private:
16 #define QUIC_FLAG(flag, value) bool saved_##flag##_;
17 #include "net/third_party/quiche/src/quiche/quic/core/quic_flags_list.h"
18 #undef QUIC_FLAG
19 #define QUICHE_PROTOCOL_FLAG(type, flag, ...) type saved_##flag##_;
20 #include "net/third_party/quiche/src/quiche/common/quiche_protocol_flags_list.h"
21 #undef QUICHE_PROTOCOL_FLAG
22 };
23 
24 //// Checks if all QUIC flags are on their default values on construction.
25 class QuicFlagChecker {
26  public:
27   QuicFlagChecker();
28 };
29 
30 #endif  // NET_QUIC_PLATFORM_IMPL_QUIC_TEST_FLAGS_UTILS_H_
31