#ifndef CONTENT_BROWSER_PRELOADING_PRERENDER_PRERENDER_METRICS_H_
#define CONTENT_BROWSER_PRELOADING_PRERENDER_PRERENDER_METRICS_H_
#include <cstdint>
#include <string>
#include "base/time/time.h"
#include "content/browser/preloading/prerender/prerender_final_status.h"
#include "content/browser/preloading/prerender/prerender_host.h"
#include "content/common/content_export.h"
#include "content/public/browser/preloading_trigger_type.h"
#include "services/metrics/public/cpp/ukm_source_id.h"
#include "third_party/abseil-cpp/absl/types/variant.h"
namespace content {
struct CONTENT_EXPORT PrerenderMismatchedHeaders { … };
enum class PrerenderCancelledInterface { … };
enum class PrerenderCrossOriginRedirectionMismatch { … };
class CONTENT_EXPORT PrerenderCancellationReason { … };
enum class PrerenderCrossOriginRedirectionProtocolChange { … };
std::string GeneratePrerenderHistogramSuffix(
PreloadingTriggerType trigger_type,
const std::string& embedder_suffix);
void RecordPrerenderTriggered(ukm::SourceId ukm_id);
void RecordPrerenderActivationTime(
base::TimeDelta delta,
PreloadingTriggerType trigger_type,
const std::string& embedder_histogram_suffix);
void RecordFailedPrerenderFinalStatus(
const PrerenderCancellationReason& cancellation_reason,
const PrerenderAttributes& attributes);
void ReportSuccessActivation(const PrerenderAttributes& attributes,
ukm::SourceId prerendered_ukm_id);
void RecordPrerenderActivationNavigationParamsMatch(
PrerenderHost::ActivationNavigationParamsMatch result,
const std::string& histogram_suffix);
void RecordPrerenderRedirectionMismatchType(
PrerenderCrossOriginRedirectionMismatch case_type,
const std::string& histogram_suffix);
void RecordPrerenderRedirectionProtocolChange(
PrerenderCrossOriginRedirectionProtocolChange change_type,
const std::string& histogram_suffix);
void RecordPrerenderActivationTransition(
int32_t potential_activation_transition,
const std::string& histogram_suffix);
enum class PrerenderBackNavigationEligibility { … };
CONTENT_EXPORT PreloadingEligibility
ToPreloadingEligibility(PrerenderBackNavigationEligibility eligibility);
void RecordPrerenderBackNavigationEligibility(
PreloadingPredictor predictor,
PrerenderBackNavigationEligibility eligibility,
PreloadingAttempt* preloading_attempt);
void RecordPrerenderActivationCommitDeferTime(
base::TimeDelta time_delta,
PreloadingTriggerType trigger_type,
const std::string& embedder_histogram_suffix);
void RecordReceivedPrerendersPerPrimaryPageChangedCount(
int number,
PreloadingTriggerType trigger_type,
const std::string& eagerness_category);
}
#endif