// Copyright 2020 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_COMMON_PROFILER_THREAD_PROFILER_PLATFORM_CONFIGURATION_H_ #define CHROME_COMMON_PROFILER_THREAD_PROFILER_PLATFORM_CONFIGURATION_H_ #include <memory> #include <optional> #include "base/functional/callback.h" #include "base/profiler/process_type.h" #include "components/version_info/channel.h" // Encapsulates the platform-specific configuration for the ThreadProfiler. // // The interface functions this class make a distinction between 'supported' and // 'enabled' state. Supported means the profiler can be run in *some* // circumstances for *some* fraction of the population on the platform/{released // Chrome channel, development/CQ build} combination. This state is intended to // enable experiment reporting. This avoids spamming UMA with experiment state // on platforms/channels where the profiler is not being run. // // Enabled means we chose to the run the profiler on at least some threads on a // platform/{released Chrome channel, development/CQ build} combination that is // configured for profiling. The overall enable/disable state should be reported // to UMA in this case. // // The std::optional<version_info::Channel> release_channel passed to functions // in this interface should be the channel for released Chrome and nullopt for // development/CQ builds. class ThreadProfilerPlatformConfiguration { … }; #endif // CHROME_COMMON_PROFILER_THREAD_PROFILER_PLATFORM_CONFIGURATION_H_