#include "cc/metrics/ukm_manager.h"
#include <utility>
#include "base/notreached.h"
#include "base/ranges/algorithm.h"
#include "base/time/time.h"
#include "cc/metrics/compositor_frame_reporter.h"
#include "components/viz/common/quads/compositor_frame.h"
#include "services/metrics/public/cpp/ukm_builders.h"
#include "services/metrics/public/cpp/ukm_recorder.h"
namespace cc {
namespace {
enum class InputMetricEvent { … };
InputMetricEvent GetInputMetricEvent(ScrollEventMetrics::ScrollType scroll_type,
EventMetrics::EventType event_type) { … }
}
UkmManager::UkmManager(std::unique_ptr<ukm::UkmRecorder> recorder)
: … { … }
UkmManager::~UkmManager() = default;
void UkmManager::SetSourceId(ukm::SourceId source_id) { … }
void UkmManager::RecordCompositorLatencyUKM(
const CompositorFrameReporter::FrameReportTypes& report_types,
const std::vector<CompositorFrameReporter::StageData>& stage_history,
const ActiveTrackers& active_trackers,
const CompositorFrameReporter::ProcessedBlinkBreakdown&
processed_blink_breakdown,
const CompositorFrameReporter::ProcessedVizBreakdown&
processed_viz_breakdown) const { … }
void UkmManager::RecordEventLatencyUKM(
const EventMetrics::List& events_metrics,
const std::vector<CompositorFrameReporter::StageData>& stage_history,
const CompositorFrameReporter::ProcessedBlinkBreakdown&
processed_blink_breakdown,
const CompositorFrameReporter::ProcessedVizBreakdown&
processed_viz_breakdown) const { … }
}