Takashi Sakamoto | 0044f2f | 2020-06-04 04:19:16 | [diff] [blame] | 1 | // Copyright 2020 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
Takashi Sakamoto | 1b5312d | 2021-10-18 08:53:46 | [diff] [blame^] | 5 | #ifndef BASE_ALLOCATOR_PARTITION_ALLOC_FEATURES_H_ |
| 6 | #define BASE_ALLOCATOR_PARTITION_ALLOC_FEATURES_H_ |
Takashi Sakamoto | 0044f2f | 2020-06-04 04:19:16 | [diff] [blame] | 7 | |
Benoit Lize | a27feee | 2020-06-10 12:48:52 | [diff] [blame] | 8 | #include "base/allocator/buildflags.h" |
Benoit Lize | bfe74a6 | 2021-04-02 04:54:04 | [diff] [blame] | 9 | #include "base/allocator/partition_allocator/partition_alloc_config.h" |
Takashi Sakamoto | 0044f2f | 2020-06-04 04:19:16 | [diff] [blame] | 10 | #include "base/base_export.h" |
Hans Wennborg | 133b1f5 | 2021-05-11 19:49:03 | [diff] [blame] | 11 | #include "base/compiler_specific.h" |
Keishi Hattori | af499ac | 2021-09-22 23:45:04 | [diff] [blame] | 12 | #include "base/metrics/field_trial_params.h" |
Takashi Sakamoto | 3f767cdd | 2020-08-20 08:37:31 | [diff] [blame] | 13 | |
Takashi Sakamoto | 0044f2f | 2020-06-04 04:19:16 | [diff] [blame] | 14 | namespace base { |
| 15 | |
Hans Wennborg | 133b1f5 | 2021-05-11 19:49:03 | [diff] [blame] | 16 | struct Feature; |
| 17 | |
Takashi Sakamoto | 0c9274d | 2020-10-08 04:17:37 | [diff] [blame] | 18 | namespace features { |
| 19 | |
Bartek Nowierski | bba1846 | 2021-06-02 02:34:47 | [diff] [blame] | 20 | #if defined(PA_ALLOW_PCSCAN) |
Anton Bikineev | 9d8b21b | 2020-10-09 08:11:58 | [diff] [blame] | 21 | extern const BASE_EXPORT Feature kPartitionAllocPCScan; |
Bartek Nowierski | bba1846 | 2021-06-02 02:34:47 | [diff] [blame] | 22 | #endif // defined(PA_ALLOW_PCSCAN) |
Anton Bikineev | db908de | 2020-12-08 14:48:13 | [diff] [blame] | 23 | #if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) |
| 24 | extern const BASE_EXPORT Feature kPartitionAllocPCScanBrowserOnly; |
Anton Bikineev | d250933 | 2021-09-16 17:14:57 | [diff] [blame] | 25 | extern const BASE_EXPORT Feature kPartitionAllocPCScanRendererOnly; |
Bartek Nowierski | d2d35f9 | 2021-04-22 21:36:39 | [diff] [blame] | 26 | extern const BASE_EXPORT Feature kPartitionAllocBackupRefPtrControl; |
Benoit Lize | 006cfcb | 2021-03-29 16:18:52 | [diff] [blame] | 27 | extern const BASE_EXPORT Feature kPartitionAllocLargeThreadCacheSize; |
Keishi Hattori | af499ac | 2021-09-22 23:45:04 | [diff] [blame] | 28 | |
| 29 | enum class BackupRefPtrEnabledProcesses { |
| 30 | // BRP enabled only on the browser process. |
| 31 | kBrowserOnly, |
| 32 | // BRP enabled only on the browser process and renderer processes. |
| 33 | kBrowserAndRenderer, |
| 34 | }; |
| 35 | extern const BASE_EXPORT Feature kPartitionAllocBackupRefPtr; |
| 36 | extern const BASE_EXPORT base::FeatureParam<BackupRefPtrEnabledProcesses> |
| 37 | kBackupRefPtrEnabledProcessesParam; |
Bartek Nowierski | 481d846 | 2021-01-09 00:30:46 | [diff] [blame] | 38 | #endif // BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) |
Takashi Sakamoto | 0044f2f | 2020-06-04 04:19:16 | [diff] [blame] | 39 | |
Michael Lippautz | d34f7b2c | 2021-04-21 08:32:26 | [diff] [blame] | 40 | extern const BASE_EXPORT Feature kPartitionAllocPCScanMUAwareScheduler; |
Anton Bikineev | ea8859b | 2021-04-29 19:17:22 | [diff] [blame] | 41 | extern const BASE_EXPORT Feature kPartitionAllocPCScanStackScanning; |
Anton Bikineev | 6b5ab95 | 2021-05-19 23:57:57 | [diff] [blame] | 42 | extern const BASE_EXPORT Feature kPartitionAllocDCScan; |
Hannes Payer | a33df7f | 2021-06-22 18:44:14 | [diff] [blame] | 43 | extern const BASE_EXPORT Feature kPartitionAllocPCScanImmediateFreeing; |
Anton Bikineev | 7f11c21 | 2021-08-24 12:03:09 | [diff] [blame] | 44 | extern const BASE_EXPORT Feature kPartitionAllocPCScanEagerClearing; |
Michael Lippautz | d34f7b2c | 2021-04-21 08:32:26 | [diff] [blame] | 45 | |
Bartek Nowierski | cd920ae1 | 2021-02-25 12:17:30 | [diff] [blame] | 46 | extern const BASE_EXPORT Feature kPartitionAllocLazyCommit; |
| 47 | |
Takashi Sakamoto | 0c9274d | 2020-10-08 04:17:37 | [diff] [blame] | 48 | } // namespace features |
Takashi Sakamoto | 0044f2f | 2020-06-04 04:19:16 | [diff] [blame] | 49 | } // namespace base |
| 50 | |
Takashi Sakamoto | 1b5312d | 2021-10-18 08:53:46 | [diff] [blame^] | 51 | #endif // BASE_ALLOCATOR_PARTITION_ALLOC_FEATURES_H_ |