#include "components/page_load_metrics/browser/page_load_metrics_util.h"
#include <algorithm>
#include <string_view>
#include "components/page_load_metrics/common/page_load_timing.h"
#include "components/page_load_metrics/common/page_visit_final_status.h"
#include "services/metrics/public/cpp/ukm_builders.h"
#include "services/metrics/public/cpp/ukm_recorder.h"
namespace page_load_metrics {
namespace {
bool IsBackgroundAbort(const PageLoadMetricsObserverDelegate& delegate) { … }
PageAbortReason GetAbortReasonForEndReason(PageEndReason end_reason) { … }
bool QueryContainsComponentHelper(const std::string_view query,
const std::string_view component,
bool component_is_prefix) { … }
}
void UmaMaxCumulativeShiftScoreHistogram10000x(
const std::string& name,
const page_load_metrics::NormalizedCLSData& normalized_cls_data) { … }
bool WasStartedInForegroundOptionalEventInForeground(
const std::optional<base::TimeDelta>& event,
const PageLoadMetricsObserverDelegate& delegate) { … }
bool WasActivatedInForegroundOptionalEventInForeground(
const std::optional<base::TimeDelta>& event,
const PageLoadMetricsObserverDelegate& delegate) { … }
bool WasStartedInForegroundOptionalEventInForegroundAfterBackForwardCacheRestore(
const std::optional<base::TimeDelta>& event,
const PageLoadMetricsObserverDelegate& delegate,
size_t index) { … }
bool WasStartedInBackgroundOptionalEventInForeground(
const std::optional<base::TimeDelta>& event,
const PageLoadMetricsObserverDelegate& delegate) { … }
bool WasInForeground(const PageLoadMetricsObserverDelegate& delegate) { … }
std::optional<base::TimeDelta> GetNonPrerenderingBackgroundStartTiming(
const PageLoadMetricsObserverDelegate& delegate) { … }
bool EventOccurredBeforeNonPrerenderingBackgroundStart(
const PageLoadMetricsObserverDelegate& delegate,
const base::TimeDelta& event) { … }
bool EventOccurredBeforeNonPrerenderingBackgroundStart(
const PageLoadMetricsObserverDelegate& delegate,
const page_load_metrics::mojom::PageLoadTiming& timing,
const base::TimeDelta& event) { … }
base::TimeDelta CorrectEventAsNavigationOrActivationOrigined(
const PageLoadMetricsObserverDelegate& delegate,
const base::TimeDelta& event) { … }
base::TimeDelta CorrectEventAsNavigationOrActivationOrigined(
const PageLoadMetricsObserverDelegate& delegate,
const page_load_metrics::mojom::PageLoadTiming& timing,
const base::TimeDelta& event) { … }
PageAbortInfo GetPageAbortInfo(
const PageLoadMetricsObserverDelegate& delegate) { … }
std::optional<base::TimeDelta> GetInitialForegroundDuration(
const PageLoadMetricsObserverDelegate& delegate,
base::TimeTicks app_background_time) { … }
bool DidObserveLoadingBehaviorInAnyFrame(
const PageLoadMetricsObserverDelegate& delegate,
blink::LoadingBehaviorFlag behavior) { … }
bool IsGoogleSearchHostname(const GURL& url) { … }
bool IsProbablyGoogleSearchUrl(const GURL& url) { … }
bool HasGoogleSearchQuery(const GURL& url) { … }
bool IsGoogleSearchResultUrl(const GURL& url) { … }
bool IsGoogleSearchHomepageUrl(const GURL& url) { … }
bool IsGoogleSearchRedirectorUrl(const GURL& url) { … }
bool IsZstdUrl(const GURL& url) { … }
bool QueryContainsComponent(const std::string_view query,
const std::string_view component) { … }
bool QueryContainsComponentPrefix(const std::string_view query,
const std::string_view component) { … }
int64_t LayoutShiftUkmValue(float shift_score) { … }
int32_t LayoutShiftUmaValue(float shift_score) { … }
int32_t LayoutShiftUmaValue10000(float shift_score) { … }
PageVisitFinalStatus RecordPageVisitFinalStatusForTiming(
const page_load_metrics::mojom::PageLoadTiming& timing,
const PageLoadMetricsObserverDelegate& delegate,
ukm::SourceId source_id) { … }
}