| // Copyright 2025 The Chromium Authors |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| #ifndef BASE_ALLOCATOR_SCHEDULER_LOOP_QUARANTINE_CONFIG_H_ |
| #define BASE_ALLOCATOR_SCHEDULER_LOOP_QUARANTINE_CONFIG_H_ |
| |
| #include <string> |
| |
| #include "base/base_export.h" |
| #include "partition_alloc/scheduler_loop_quarantine_support.h" |
| |
| // This header declares utilities to load |
| // `::partition_alloc::internal::SchedulerLoopQuarantineConfig` for the current |
| // process from the feature list. |
| namespace base::allocator { |
| |
| enum class SchedulerLoopQuarantineBranchType { |
| // The global quarantine branch, shared across threads. |
| kGlobal, |
| // Default configuration for thread-local branches on new threads. |
| kThreadLocalDefault, |
| // Specialized configuration for the main thread of a process. |
| kMain, |
| // Specialized configuration for the IO thread of a process. |
| kIO, |
| // One for `SANITIZED_OBJECT()` objects. |
| kSanitizedObject, |
| // Specialized configuration for the VizCompositorThread. |
| kVizCompositor, |
| // Specialized configuration for the CompositorGpuThread. |
| kCompositorGpu, |
| }; |
| |
| // Returns quarantine configuration for `process_type_identifier` and |
| // `branch_type`. |
| BASE_EXPORT ::partition_alloc::internal::SchedulerLoopQuarantineConfig |
| GetSchedulerLoopQuarantineConfiguration( |
| std::string_view process_type_identifier, |
| SchedulerLoopQuarantineBranchType branch_type); |
| |
| // Returns whether any branch for `process_type_identifier` has enabled |
| // task-controlled purge or pause in between tasks. |
| BASE_EXPORT bool HasSchedulerLoopQuarantineTaskControl( |
| std::string_view process_type_identifier); |
| |
| } // namespace base::allocator |
| |
| #endif // BASE_ALLOCATOR_SCHEDULER_LOOP_QUARANTINE_CONFIG_H_ |