xref: /aosp_15_r20/external/cronet/components/cronet/android/cronet_base_feature.h (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1 // Copyright 2023 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 COMPONENTS_CRONET_ANDROID_CRONET_BASE_FEATURE_H_
6 #define COMPONENTS_CRONET_ANDROID_CRONET_BASE_FEATURE_H_
7 
8 #include "components/cronet/android/proto/base_feature_overrides.pb.h"
9 
10 namespace cronet {
11 
12 // Applies the base::Feature overrides in `overrides`, making them globally
13 // accessible through the standard base::Feature API.
14 //
15 // Note that this function mutates global state, and will affect the behavior
16 // of code accessing base::Features after this call.
17 //
18 // If base::Feature is already initialized, this function logs a warning and
19 // does nothing. (This is not supposed to happen in production, but it can
20 // happen in the context of some native tests that end up indirectly calling
21 // this under a base::test::ScopedFeatureList.)
22 void ApplyBaseFeatureOverrides(
23     const ::org::chromium::net::httpflags::BaseFeatureOverrides& overrides);
24 
25 }  // namespace cronet
26 
27 #endif  // COMPONENTS_CRONET_ANDROID_CRONET_BASE_FEATURE_H_
28