• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2020 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 #include "base/allocator/partition_alloc_features.h"
6 
7 #include "base/allocator/miracle_parameter.h"
8 #include "base/base_export.h"
9 #include "base/feature_list.h"
10 #include "base/features.h"
11 #include "base/metrics/field_trial_params.h"
12 #include "base/time/time.h"
13 #include "build/build_config.h"
14 #include "build/chromecast_buildflags.h"
15 #include "build/chromeos_buildflags.h"
16 #include "partition_alloc/buildflags.h"
17 #include "partition_alloc/partition_alloc_base/time/time.h"
18 #include "partition_alloc/partition_alloc_constants.h"
19 #include "partition_alloc/partition_root.h"
20 #include "partition_alloc/shim/allocator_shim_dispatch_to_noop_on_free.h"
21 #include "partition_alloc/thread_cache.h"
22 
23 namespace base {
24 namespace features {
25 
26 namespace {
27 
28 static constexpr char kPAFeatureEnabledProcessesStr[] = "enabled-processes";
29 static constexpr char kBrowserOnlyStr[] = "browser-only";
30 static constexpr char kBrowserAndRendererStr[] = "browser-and-renderer";
31 static constexpr char kNonRendererStr[] = "non-renderer";
32 static constexpr char kAllProcessesStr[] = "all-processes";
33 
34 #if PA_CONFIG(ENABLE_SHADOW_METADATA)
35 static constexpr char kRendererOnlyStr[] = "renderer-only";
36 static constexpr char kAllChildProcessesStr[] = "all-child-processes";
37 #endif  // PA_CONFIG(ENABLE_SHADOW_METADATA)
38 
39 }  // namespace
40 
41 BASE_FEATURE(kPartitionAllocUnretainedDanglingPtr,
42              "PartitionAllocUnretainedDanglingPtr",
43              FEATURE_ENABLED_BY_DEFAULT);
44 
45 constexpr FeatureParam<UnretainedDanglingPtrMode>::Option
46     kUnretainedDanglingPtrModeOption[] = {
47         {UnretainedDanglingPtrMode::kCrash, "crash"},
48         {UnretainedDanglingPtrMode::kDumpWithoutCrashing,
49          "dump_without_crashing"},
50 };
51 const base::FeatureParam<UnretainedDanglingPtrMode>
52     kUnretainedDanglingPtrModeParam = {
53         &kPartitionAllocUnretainedDanglingPtr,
54         "mode",
55         UnretainedDanglingPtrMode::kCrash,
56         &kUnretainedDanglingPtrModeOption,
57 };
58 
59 // Note: DPD conflicts with no-op `free()` (see
60 // `base::allocator::MakeFreeNoOp()`). No-op `free()` stands down in the
61 // presence of DPD, but hypothetically fully launching DPD should prompt
62 // a rethink of no-op `free()`.
63 BASE_FEATURE(kPartitionAllocDanglingPtr,
64              "PartitionAllocDanglingPtr",
65 #if PA_BUILDFLAG(ENABLE_DANGLING_RAW_PTR_FEATURE_FLAG)
66              FEATURE_ENABLED_BY_DEFAULT
67 #else
68              FEATURE_DISABLED_BY_DEFAULT
69 #endif
70 );
71 
72 constexpr FeatureParam<DanglingPtrMode>::Option kDanglingPtrModeOption[] = {
73     {DanglingPtrMode::kCrash, "crash"},
74     {DanglingPtrMode::kLogOnly, "log_only"},
75 };
76 const base::FeatureParam<DanglingPtrMode> kDanglingPtrModeParam{
77     &kPartitionAllocDanglingPtr,
78     "mode",
79     DanglingPtrMode::kCrash,
80     &kDanglingPtrModeOption,
81 };
82 constexpr FeatureParam<DanglingPtrType>::Option kDanglingPtrTypeOption[] = {
83     {DanglingPtrType::kAll, "all"},
84     {DanglingPtrType::kCrossTask, "cross_task"},
85 };
86 const base::FeatureParam<DanglingPtrType> kDanglingPtrTypeParam{
87     &kPartitionAllocDanglingPtr,
88     "type",
89     DanglingPtrType::kAll,
90     &kDanglingPtrTypeOption,
91 };
92 
93 #if PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
94 // Use a larger maximum thread cache cacheable bucket size.
95 BASE_FEATURE(kPartitionAllocLargeThreadCacheSize,
96              "PartitionAllocLargeThreadCacheSize",
97              FEATURE_ENABLED_BY_DEFAULT);
98 
99 MIRACLE_PARAMETER_FOR_INT(GetPartitionAllocLargeThreadCacheSizeValue,
100                           kPartitionAllocLargeThreadCacheSize,
101                           "PartitionAllocLargeThreadCacheSizeValue",
102                           ::partition_alloc::kThreadCacheLargeSizeThreshold)
103 
104 MIRACLE_PARAMETER_FOR_INT(
105     GetPartitionAllocLargeThreadCacheSizeValueForLowRAMAndroid,
106     kPartitionAllocLargeThreadCacheSize,
107     "PartitionAllocLargeThreadCacheSizeValueForLowRAMAndroid",
108     ::partition_alloc::kThreadCacheDefaultSizeThreshold)
109 
110 BASE_FEATURE(kPartitionAllocLargeEmptySlotSpanRing,
111              "PartitionAllocLargeEmptySlotSpanRing",
112 #if BUILDFLAG(IS_MAC)
113              FEATURE_ENABLED_BY_DEFAULT);
114 #else
115              FEATURE_DISABLED_BY_DEFAULT);
116 #endif
117 
118 BASE_FEATURE(kPartitionAllocWithAdvancedChecks,
119              "PartitionAllocWithAdvancedChecks",
120              FEATURE_DISABLED_BY_DEFAULT);
121 constexpr FeatureParam<PartitionAllocWithAdvancedChecksEnabledProcesses>::Option
122     kPartitionAllocWithAdvancedChecksEnabledProcessesOptions[] = {
123         {PartitionAllocWithAdvancedChecksEnabledProcesses::kBrowserOnly,
124          kBrowserOnlyStr},
125         {PartitionAllocWithAdvancedChecksEnabledProcesses::kBrowserAndRenderer,
126          kBrowserAndRendererStr},
127         {PartitionAllocWithAdvancedChecksEnabledProcesses::kNonRenderer,
128          kNonRendererStr},
129         {PartitionAllocWithAdvancedChecksEnabledProcesses::kAllProcesses,
130          kAllProcessesStr}};
131 const base::FeatureParam<PartitionAllocWithAdvancedChecksEnabledProcesses>
132     kPartitionAllocWithAdvancedChecksEnabledProcessesParam{
133         &kPartitionAllocWithAdvancedChecks, kPAFeatureEnabledProcessesStr,
134         PartitionAllocWithAdvancedChecksEnabledProcesses::kBrowserOnly,
135         &kPartitionAllocWithAdvancedChecksEnabledProcessesOptions};
136 
137 BASE_FEATURE(kPartitionAllocSchedulerLoopQuarantine,
138              "PartitionAllocSchedulerLoopQuarantine",
139              FEATURE_DISABLED_BY_DEFAULT);
140 // Scheduler Loop Quarantine's per-branch capacity in bytes.
141 const base::FeatureParam<int>
142     kPartitionAllocSchedulerLoopQuarantineBranchCapacity{
143         &kPartitionAllocSchedulerLoopQuarantine,
144         "PartitionAllocSchedulerLoopQuarantineBranchCapacity", 0};
145 
146 BASE_FEATURE(kPartitionAllocZappingByFreeFlags,
147              "PartitionAllocZappingByFreeFlags",
148              FEATURE_DISABLED_BY_DEFAULT);
149 
150 BASE_FEATURE(kPartitionAllocEventuallyZeroFreedMemory,
151              "PartitionAllocEventuallyZeroFreedMemory",
152              FEATURE_DISABLED_BY_DEFAULT);
153 #endif  // PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
154 
155 BASE_FEATURE(kPartitionAllocBackupRefPtr,
156              "PartitionAllocBackupRefPtr",
157 #if PA_BUILDFLAG(ENABLE_BACKUP_REF_PTR_FEATURE_FLAG)
158              FEATURE_ENABLED_BY_DEFAULT
159 #else
160              FEATURE_DISABLED_BY_DEFAULT
161 #endif
162 );
163 
164 constexpr FeatureParam<BackupRefPtrEnabledProcesses>::Option
165     kBackupRefPtrEnabledProcessesOptions[] = {
166         {BackupRefPtrEnabledProcesses::kBrowserOnly, kBrowserOnlyStr},
167         {BackupRefPtrEnabledProcesses::kBrowserAndRenderer,
168          kBrowserAndRendererStr},
169         {BackupRefPtrEnabledProcesses::kNonRenderer, kNonRendererStr},
170         {BackupRefPtrEnabledProcesses::kAllProcesses, kAllProcessesStr}};
171 
172 const base::FeatureParam<BackupRefPtrEnabledProcesses>
173     kBackupRefPtrEnabledProcessesParam{
174         &kPartitionAllocBackupRefPtr, kPAFeatureEnabledProcessesStr,
175 #if PA_BUILDFLAG(IS_MAC) && PA_BUILDFLAG(PA_ARCH_CPU_ARM64)
176         BackupRefPtrEnabledProcesses::kNonRenderer,
177 #else
178         BackupRefPtrEnabledProcesses::kAllProcesses,
179 #endif
180         &kBackupRefPtrEnabledProcessesOptions};
181 
182 constexpr FeatureParam<BackupRefPtrMode>::Option kBackupRefPtrModeOptions[] = {
183     {BackupRefPtrMode::kDisabled, "disabled"},
184     {BackupRefPtrMode::kEnabled, "enabled"},
185 };
186 
187 const base::FeatureParam<BackupRefPtrMode> kBackupRefPtrModeParam{
188     &kPartitionAllocBackupRefPtr, "brp-mode", BackupRefPtrMode::kEnabled,
189     &kBackupRefPtrModeOptions};
190 
191 BASE_FEATURE(kPartitionAllocMemoryTagging,
192              "PartitionAllocMemoryTagging",
193 #if PA_BUILDFLAG(USE_FULL_MTE) || BUILDFLAG(IS_ANDROID)
194              FEATURE_ENABLED_BY_DEFAULT
195 #else
196              FEATURE_DISABLED_BY_DEFAULT
197 #endif
198 );
199 
200 constexpr FeatureParam<MemtagMode>::Option kMemtagModeOptions[] = {
201     {MemtagMode::kSync, "sync"},
202     {MemtagMode::kAsync, "async"}};
203 
204 const base::FeatureParam<MemtagMode> kMemtagModeParam{
205     &kPartitionAllocMemoryTagging, "memtag-mode",
206 #if PA_BUILDFLAG(USE_FULL_MTE)
207     MemtagMode::kSync,
208 #else
209     MemtagMode::kAsync,
210 #endif
211     &kMemtagModeOptions};
212 
213 constexpr FeatureParam<RetagMode>::Option kRetagModeOptions[] = {
214     {RetagMode::kIncrement, "increment"},
215     {RetagMode::kRandom, "random"},
216 };
217 
218 const base::FeatureParam<RetagMode> kRetagModeParam{
219     &kPartitionAllocMemoryTagging, "retag-mode", RetagMode::kIncrement,
220     &kRetagModeOptions};
221 
222 constexpr FeatureParam<MemoryTaggingEnabledProcesses>::Option
223     kMemoryTaggingEnabledProcessesOptions[] = {
224         {MemoryTaggingEnabledProcesses::kBrowserOnly, kBrowserOnlyStr},
225         {MemoryTaggingEnabledProcesses::kNonRenderer, kNonRendererStr},
226         {MemoryTaggingEnabledProcesses::kAllProcesses, kAllProcessesStr}};
227 
228 const base::FeatureParam<MemoryTaggingEnabledProcesses>
229     kMemoryTaggingEnabledProcessesParam{
230         &kPartitionAllocMemoryTagging, kPAFeatureEnabledProcessesStr,
231 #if PA_BUILDFLAG(USE_FULL_MTE)
232         MemoryTaggingEnabledProcesses::kAllProcesses,
233 #else
234         MemoryTaggingEnabledProcesses::kNonRenderer,
235 #endif
236         &kMemoryTaggingEnabledProcessesOptions};
237 
238 BASE_FEATURE(kKillPartitionAllocMemoryTagging,
239              "KillPartitionAllocMemoryTagging",
240              FEATURE_DISABLED_BY_DEFAULT);
241 
242 BASE_EXPORT BASE_DECLARE_FEATURE(kPartitionAllocPermissiveMte);
243 BASE_FEATURE(kPartitionAllocPermissiveMte,
244              "PartitionAllocPermissiveMte",
245 #if PA_BUILDFLAG(USE_FULL_MTE)
246              // We want to actually crash if USE_FULL_MTE is enabled.
247              FEATURE_DISABLED_BY_DEFAULT
248 #else
249              FEATURE_ENABLED_BY_DEFAULT
250 #endif
251 );
252 
253 const base::FeatureParam<bool> kBackupRefPtrAsanEnableDereferenceCheckParam{
254     &kPartitionAllocBackupRefPtr, "asan-enable-dereference-check", true};
255 const base::FeatureParam<bool> kBackupRefPtrAsanEnableExtractionCheckParam{
256     &kPartitionAllocBackupRefPtr, "asan-enable-extraction-check",
257     false};  // Not much noise at the moment to enable by default.
258 const base::FeatureParam<bool> kBackupRefPtrAsanEnableInstantiationCheckParam{
259     &kPartitionAllocBackupRefPtr, "asan-enable-instantiation-check", true};
260 
261 // If enabled, switches the bucket distribution to a denser one.
262 //
263 // We enable this by default everywhere except for 32-bit Android, since we saw
264 // regressions there.
265 BASE_FEATURE(kPartitionAllocUseDenserDistribution,
266              "PartitionAllocUseDenserDistribution",
267 #if BUILDFLAG(IS_ANDROID) && defined(ARCH_CPU_32_BITS)
268              FEATURE_DISABLED_BY_DEFAULT
269 #else
270              FEATURE_ENABLED_BY_DEFAULT
271 #endif  // BUILDFLAG(IS_ANDROID) && defined(ARCH_CPU_32_BITS)
272 );
273 const base::FeatureParam<BucketDistributionMode>::Option
274     kPartitionAllocBucketDistributionOption[] = {
275         {BucketDistributionMode::kDefault, "default"},
276         {BucketDistributionMode::kDenser, "denser"},
277 };
278 const base::FeatureParam<BucketDistributionMode>
279     kPartitionAllocBucketDistributionParam {
280   &kPartitionAllocUseDenserDistribution, "mode",
281 #if BUILDFLAG(IS_ANDROID) && defined(ARCH_CPU_32_BITS)
282       BucketDistributionMode::kDefault,
283 #else
284       BucketDistributionMode::kDenser,
285 #endif  // BUILDFLAG(IS_ANDROID) && defined(ARCH_CPU_32_BITS)
286       &kPartitionAllocBucketDistributionOption
287 };
288 
289 BASE_FEATURE(kPartitionAllocMemoryReclaimer,
290              "PartitionAllocMemoryReclaimer",
291              FEATURE_ENABLED_BY_DEFAULT);
292 const base::FeatureParam<TimeDelta> kPartitionAllocMemoryReclaimerInterval = {
293     &kPartitionAllocMemoryReclaimer, "interval",
294     TimeDelta(),  // Defaults to zero.
295 };
296 
297 // Configures whether we set a lower limit for renderers that do not have a main
298 // frame, similar to the limit that is already done for backgrounded renderers.
299 BASE_FEATURE(kLowerPAMemoryLimitForNonMainRenderers,
300              "LowerPAMemoryLimitForNonMainRenderers",
301              FEATURE_DISABLED_BY_DEFAULT);
302 
303 // Whether to straighten free lists for larger slot spans in PurgeMemory() ->
304 // ... -> PartitionPurgeSlotSpan().
305 BASE_FEATURE(kPartitionAllocStraightenLargerSlotSpanFreeLists,
306              "PartitionAllocStraightenLargerSlotSpanFreeLists",
307              FEATURE_ENABLED_BY_DEFAULT);
308 const base::FeatureParam<
309     partition_alloc::StraightenLargerSlotSpanFreeListsMode>::Option
310     kPartitionAllocStraightenLargerSlotSpanFreeListsModeOption[] = {
311         {partition_alloc::StraightenLargerSlotSpanFreeListsMode::
312              kOnlyWhenUnprovisioning,
313          "only-when-unprovisioning"},
314         {partition_alloc::StraightenLargerSlotSpanFreeListsMode::kAlways,
315          "always"},
316 };
317 const base::FeatureParam<partition_alloc::StraightenLargerSlotSpanFreeListsMode>
318     kPartitionAllocStraightenLargerSlotSpanFreeListsMode = {
319         &kPartitionAllocStraightenLargerSlotSpanFreeLists,
320         "mode",
321         partition_alloc::StraightenLargerSlotSpanFreeListsMode::
322             kOnlyWhenUnprovisioning,
323         &kPartitionAllocStraightenLargerSlotSpanFreeListsModeOption,
324 };
325 
326 // Whether to sort free lists for smaller slot spans in PurgeMemory().
327 BASE_FEATURE(kPartitionAllocSortSmallerSlotSpanFreeLists,
328              "PartitionAllocSortSmallerSlotSpanFreeLists",
329              FEATURE_ENABLED_BY_DEFAULT);
330 
331 // Whether to sort the active slot spans in PurgeMemory().
332 BASE_FEATURE(kPartitionAllocSortActiveSlotSpans,
333              "PartitionAllocSortActiveSlotSpans",
334              FEATURE_DISABLED_BY_DEFAULT);
335 
336 #if BUILDFLAG(IS_WIN)
337 // Whether to retry allocations when commit fails.
338 BASE_FEATURE(kPageAllocatorRetryOnCommitFailure,
339              "PageAllocatorRetryOnCommitFailure",
340              FEATURE_DISABLED_BY_DEFAULT);
341 #endif
342 
343 #if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_CHROMEOS)
344 // A parameter to exclude or not exclude PartitionAllocSupport from
345 // PartialLowModeOnMidRangeDevices. This is used to see how it affects
346 // renderer performances, e.g. blink_perf.parser benchmark.
347 // The feature: kPartialLowEndModeOnMidRangeDevices is defined in
348 // //base/features.cc. Since the following feature param is related to
349 // PartitionAlloc, define the param here.
350 const FeatureParam<bool> kPartialLowEndModeExcludePartitionAllocSupport{
351     &kPartialLowEndModeOnMidRangeDevices, "exclude-partition-alloc-support",
352     false};
353 #endif
354 
355 BASE_FEATURE(kEnableConfigurableThreadCacheMultiplier,
356              "EnableConfigurableThreadCacheMultiplier",
357              base::FEATURE_DISABLED_BY_DEFAULT);
358 
359 MIRACLE_PARAMETER_FOR_DOUBLE(GetThreadCacheMultiplier,
360                              kEnableConfigurableThreadCacheMultiplier,
361                              "ThreadCacheMultiplier",
362                              2.)
363 
364 MIRACLE_PARAMETER_FOR_DOUBLE(GetThreadCacheMultiplierForAndroid,
365                              kEnableConfigurableThreadCacheMultiplier,
366                              "ThreadCacheMultiplierForAndroid",
367                              1.)
368 
ToPartitionAllocTimeDelta(base::TimeDelta time_delta)369 constexpr partition_alloc::internal::base::TimeDelta ToPartitionAllocTimeDelta(
370     base::TimeDelta time_delta) {
371   return partition_alloc::internal::base::Microseconds(
372       time_delta.InMicroseconds());
373 }
374 
FromPartitionAllocTimeDelta(partition_alloc::internal::base::TimeDelta time_delta)375 constexpr base::TimeDelta FromPartitionAllocTimeDelta(
376     partition_alloc::internal::base::TimeDelta time_delta) {
377   return base::Microseconds(time_delta.InMicroseconds());
378 }
379 
380 BASE_FEATURE(kEnableConfigurableThreadCachePurgeInterval,
381              "EnableConfigurableThreadCachePurgeInterval",
382              base::FEATURE_DISABLED_BY_DEFAULT);
383 
384 MIRACLE_PARAMETER_FOR_TIME_DELTA(
385     GetThreadCacheMinPurgeIntervalValue,
386     kEnableConfigurableThreadCachePurgeInterval,
387     "ThreadCacheMinPurgeInterval",
388     FromPartitionAllocTimeDelta(partition_alloc::kMinPurgeInterval))
389 
390 MIRACLE_PARAMETER_FOR_TIME_DELTA(
391     GetThreadCacheMaxPurgeIntervalValue,
392     kEnableConfigurableThreadCachePurgeInterval,
393     "ThreadCacheMaxPurgeInterval",
394     FromPartitionAllocTimeDelta(partition_alloc::kMaxPurgeInterval))
395 
396 MIRACLE_PARAMETER_FOR_TIME_DELTA(
397     GetThreadCacheDefaultPurgeIntervalValue,
398     kEnableConfigurableThreadCachePurgeInterval,
399     "ThreadCacheDefaultPurgeInterval",
400     FromPartitionAllocTimeDelta(partition_alloc::kDefaultPurgeInterval))
401 
402 const partition_alloc::internal::base::TimeDelta
GetThreadCacheMinPurgeInterval()403 GetThreadCacheMinPurgeInterval() {
404   return ToPartitionAllocTimeDelta(GetThreadCacheMinPurgeIntervalValue());
405 }
406 
407 const partition_alloc::internal::base::TimeDelta
GetThreadCacheMaxPurgeInterval()408 GetThreadCacheMaxPurgeInterval() {
409   return ToPartitionAllocTimeDelta(GetThreadCacheMaxPurgeIntervalValue());
410 }
411 
412 const partition_alloc::internal::base::TimeDelta
GetThreadCacheDefaultPurgeInterval()413 GetThreadCacheDefaultPurgeInterval() {
414   return ToPartitionAllocTimeDelta(GetThreadCacheDefaultPurgeIntervalValue());
415 }
416 
417 BASE_FEATURE(kEnableConfigurableThreadCacheMinCachedMemoryForPurging,
418              "EnableConfigurableThreadCacheMinCachedMemoryForPurging",
419              base::FEATURE_DISABLED_BY_DEFAULT);
420 
421 MIRACLE_PARAMETER_FOR_INT(
422     GetThreadCacheMinCachedMemoryForPurgingBytes,
423     kEnableConfigurableThreadCacheMinCachedMemoryForPurging,
424     "ThreadCacheMinCachedMemoryForPurgingBytes",
425     partition_alloc::kMinCachedMemoryForPurgingBytes)
426 
427 // An apparent quarantine leak in the buffer partition unacceptably
428 // bloats memory when MiraclePtr is enabled in the renderer process.
429 // We believe we have found and patched the leak, but out of an
430 // abundance of caution, we provide this toggle that allows us to
431 // wholly disable MiraclePtr in the buffer partition, if necessary.
432 //
433 // TODO(crbug.com/40064499): this is unneeded once
434 // MiraclePtr-for-Renderer launches.
435 BASE_FEATURE(kPartitionAllocDisableBRPInBufferPartition,
436              "PartitionAllocDisableBRPInBufferPartition",
437              FEATURE_DISABLED_BY_DEFAULT);
438 
439 #if PA_BUILDFLAG(USE_FREELIST_DISPATCHER)
440 BASE_FEATURE(kUsePoolOffsetFreelists,
441              "PartitionAllocUsePoolOffsetFreelists",
442 #if BUILDFLAG(IS_ANDROID)
443              base::FEATURE_DISABLED_BY_DEFAULT
444 #else
445              base::FEATURE_ENABLED_BY_DEFAULT
446 #endif
447 );
448 #endif
449 
450 BASE_FEATURE(kPartitionAllocAdjustSizeWhenInForeground,
451              "PartitionAllocAdjustSizeWhenInForeground",
452 #if BUILDFLAG(IS_MAC)
453              FEATURE_ENABLED_BY_DEFAULT);
454 #else
455              FEATURE_DISABLED_BY_DEFAULT);
456 #endif
457 
458 BASE_FEATURE(kPartitionAllocUseSmallSingleSlotSpans,
459              "PartitionAllocUseSmallSingleSlotSpans",
460              base::FEATURE_DISABLED_BY_DEFAULT);
461 
462 #if PA_CONFIG(ENABLE_SHADOW_METADATA)
463 BASE_FEATURE(kPartitionAllocShadowMetadata,
464              "PartitionAllocShadowMetadata",
465              base::FEATURE_DISABLED_BY_DEFAULT);
466 
467 constexpr FeatureParam<ShadowMetadataEnabledProcesses>::Option
468     kShadowMetadataEnabledProcessesOptions[] = {
469         {ShadowMetadataEnabledProcesses::kRendererOnly, kRendererOnlyStr},
470         {ShadowMetadataEnabledProcesses::kAllChildProcesses,
471          kAllChildProcessesStr}};
472 
473 const base::FeatureParam<ShadowMetadataEnabledProcesses>
474     kShadowMetadataEnabledProcessesParam{
475         &kPartitionAllocShadowMetadata, kPAFeatureEnabledProcessesStr,
476         ShadowMetadataEnabledProcesses::kRendererOnly,
477         &kShadowMetadataEnabledProcessesOptions};
478 #endif  // PA_CONFIG(ENABLE_SHADOW_METADATA)
479 
480 }  // namespace features
481 }  // namespace base
482