#include "components/gwp_asan/client/sampling_helpers.h"
#include <optional>
#include <string_view>
#include "base/containers/fixed_flat_map.h"
#include "base/functional/callback_helpers.h"
#include "base/metrics/histogram.h"
#include "base/metrics/histogram_functions.h"
#include "base/numerics/safe_math.h"
#include "base/strings/strcat.h"
namespace gwp_asan::internal {
namespace {
inline constexpr base::Histogram::Sample kMaxSample = …;
constexpr auto kProcessMap = …;
void ReportOomHistogram(base::HistogramBase* histogram,
size_t sampling_frequency,
size_t allocations) { … }
}
GuardedPageAllocator::OutOfMemoryCallback CreateOomCallback(
std::string_view allocator_name,
std::string_view process_type,
size_t sampling_frequency) { … }
std::optional<std::string_view> ProcessString(std::string_view process_type) { … }
void ReportGwpAsanActivated(std::string_view allocator_name,
std::string_view process_type,
bool activated) { … }
}