#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "content/common/peak_gpu_memory_callback.h"
#include <memory>
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/location.h"
#include "base/metrics/histogram_macros.h"
#include "base/strings/strcat.h"
namespace content {
namespace {
constexpr int kUsageTypeCount = …;
constexpr int kAllocationSourceTypeCount = …;
constexpr int kAllocationSourceHistogramIndex = …;
constexpr int kMemoryHistogramMin = …;
constexpr int kMemoryHistogramMax = …;
constexpr int kMemoryHistogramBucketCount = …;
constexpr const char* GetUsageName(input::PeakGpuMemoryTracker::Usage usage) { … }
constexpr const char* GetAllocationSourceName(
gpu::GpuPeakMemoryAllocationSource source) { … }
std::string GetPeakMemoryUsageUMAName(
input::PeakGpuMemoryTracker::Usage usage) { … }
std::string GetPeakMemoryAllocationSourceUMAName(
input::PeakGpuMemoryTracker::Usage usage,
gpu::GpuPeakMemoryAllocationSource source) { … }
}
void PeakGpuMemoryCallback(
input::PeakGpuMemoryTracker::Usage usage,
base::OnceClosure testing_callback,
const uint64_t peak_memory,
const base::flat_map<gpu::GpuPeakMemoryAllocationSource, uint64_t>&
allocation_per_source) { … }
}