blob: a36fb014c50135ce04c163b42ae9211d40481740 [file] [log] [blame]
Takashi Sakamoto0044f2f2020-06-04 04:19:161// 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 Sakamoto1b5312d2021-10-18 08:53:465#ifndef BASE_ALLOCATOR_PARTITION_ALLOC_FEATURES_H_
6#define BASE_ALLOCATOR_PARTITION_ALLOC_FEATURES_H_
Takashi Sakamoto0044f2f2020-06-04 04:19:167
Benoit Lizea27feee2020-06-10 12:48:528#include "base/allocator/buildflags.h"
Benoit Lizebfe74a62021-04-02 04:54:049#include "base/allocator/partition_allocator/partition_alloc_config.h"
Takashi Sakamoto0044f2f2020-06-04 04:19:1610#include "base/base_export.h"
Hans Wennborg133b1f52021-05-11 19:49:0311#include "base/compiler_specific.h"
Keishi Hattoriaf499ac2021-09-22 23:45:0412#include "base/metrics/field_trial_params.h"
Takashi Sakamoto3f767cdd2020-08-20 08:37:3113
Takashi Sakamoto0044f2f2020-06-04 04:19:1614namespace base {
15
Hans Wennborg133b1f52021-05-11 19:49:0316struct Feature;
17
Takashi Sakamoto0c9274d2020-10-08 04:17:3718namespace features {
19
Bartek Nowierskibba18462021-06-02 02:34:4720#if defined(PA_ALLOW_PCSCAN)
Anton Bikineev9d8b21b2020-10-09 08:11:5821extern const BASE_EXPORT Feature kPartitionAllocPCScan;
Bartek Nowierskibba18462021-06-02 02:34:4722#endif // defined(PA_ALLOW_PCSCAN)
Anton Bikineevdb908de2020-12-08 14:48:1323#if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
24extern const BASE_EXPORT Feature kPartitionAllocPCScanBrowserOnly;
Anton Bikineevd2509332021-09-16 17:14:5725extern const BASE_EXPORT Feature kPartitionAllocPCScanRendererOnly;
Bartek Nowierskid2d35f92021-04-22 21:36:3926extern const BASE_EXPORT Feature kPartitionAllocBackupRefPtrControl;
Benoit Lize006cfcb2021-03-29 16:18:5227extern const BASE_EXPORT Feature kPartitionAllocLargeThreadCacheSize;
Keishi Hattoriaf499ac2021-09-22 23:45:0428
29enum 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};
35extern const BASE_EXPORT Feature kPartitionAllocBackupRefPtr;
36extern const BASE_EXPORT base::FeatureParam<BackupRefPtrEnabledProcesses>
37 kBackupRefPtrEnabledProcessesParam;
Bartek Nowierski481d8462021-01-09 00:30:4638#endif // BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
Takashi Sakamoto0044f2f2020-06-04 04:19:1639
Michael Lippautzd34f7b2c2021-04-21 08:32:2640extern const BASE_EXPORT Feature kPartitionAllocPCScanMUAwareScheduler;
Anton Bikineevea8859b2021-04-29 19:17:2241extern const BASE_EXPORT Feature kPartitionAllocPCScanStackScanning;
Anton Bikineev6b5ab952021-05-19 23:57:5742extern const BASE_EXPORT Feature kPartitionAllocDCScan;
Hannes Payera33df7f2021-06-22 18:44:1443extern const BASE_EXPORT Feature kPartitionAllocPCScanImmediateFreeing;
Anton Bikineev7f11c212021-08-24 12:03:0944extern const BASE_EXPORT Feature kPartitionAllocPCScanEagerClearing;
Michael Lippautzd34f7b2c2021-04-21 08:32:2645
Bartek Nowierskicd920ae12021-02-25 12:17:3046extern const BASE_EXPORT Feature kPartitionAllocLazyCommit;
47
Takashi Sakamoto0c9274d2020-10-08 04:17:3748} // namespace features
Takashi Sakamoto0044f2f2020-06-04 04:19:1649} // namespace base
50
Takashi Sakamoto1b5312d2021-10-18 08:53:4651#endif // BASE_ALLOCATOR_PARTITION_ALLOC_FEATURES_H_