chromium/components/page_load_metrics/browser/page_load_metrics_util.cc

// Copyright 2015 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#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) {}

// Common helper for QueryContainsComponent and QueryContainsComponentPrefix.
bool QueryContainsComponentHelper(const std::string_view query,
                                  const std::string_view component,
                                  bool component_is_prefix) {}

}  // namespace

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) {}

// There is a copy of this function in prerender_page_load_metrics_observer.cc.
// Please keep this consistent with the function.
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) {}

// Currently, multiple implementations of PageLoadMetricsObserver is ongoing.
// We'll left the old version for a while.
// TODO(crbug.com/40222513): Use the above version and delete this.
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) {}

// Currently, multiple implementations of PageLoadMetricsObserver is ongoing.
// We'll left the old version for a while.
// TODO(crbug.com/40222513): Use the above version and delete this.
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) {}

// Determine if the given url has query associated with it.
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) {}

}  // namespace page_load_metrics