chromium/components/page_load_metrics/browser/observers/prerender_page_load_metrics_observer.h

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

#ifndef COMPONENTS_PAGE_LOAD_METRICS_BROWSER_OBSERVERS_PRERENDER_PAGE_LOAD_METRICS_OBSERVER_H_
#define COMPONENTS_PAGE_LOAD_METRICS_BROWSER_OBSERVERS_PRERENDER_PAGE_LOAD_METRICS_OBSERVER_H_

#include <optional>

#include "components/page_load_metrics/browser/page_load_metrics_observer.h"
#include "content/public/browser/preloading_trigger_type.h"

namespace internal {

extern const char kHistogramPrerenderNavigationToActivation[];
extern const char kHistogramPrerenderActivationToFirstPaint[];
extern const char kHistogramPrerenderActivationToFirstContentfulPaint[];
extern const char kHistogramPrerenderActivationToLargestContentfulPaint2[];
extern const char kHistogramPrerenderFirstInputDelay4[];
extern const char kHistogramPrerenderCumulativeShiftScore[];
extern const char kHistogramPrerenderCumulativeShiftScoreMainFrame[];
extern const char
    kHistogramPrerenderMaxCumulativeShiftScoreSessionWindowGap1000msMax5000ms2
        [];

// Responsiveness metrics.
extern const char
    kHistogramPrerenderAverageUserInteractionLatencyOverBudgetMaxEventDuration
        [];
extern const char kHistogramPrerenderNumInteractions[];
extern const char
    kHistogramPrerenderUserInteractionLatencyHighPercentile2MaxEventDuration[];
extern const char
    kHistogramPrerenderWorstUserInteractionLatencyMaxEventDuration[];

extern const char kPageLoadPrerenderObserverEvent[];

// These values are persisted to logs. Entries should not be renumbered and
// numeric values should never be reused.
enum class PageLoadPrerenderObserverEvent {};

}  // namespace internal

namespace page_load_metrics {
struct ExtraRequestCompleteInfo;
}  // namespace page_load_metrics

namespace net {
enum Error;
}  // namespace net

// Prerender2 (content/browser/preloading/prerender/README.md):
// Records custom page load timing and loading status metrics for prerendered
// page loads.
class PrerenderPageLoadMetricsObserver
    : public page_load_metrics::PageLoadMetricsObserver {};

#endif  // COMPONENTS_PAGE_LOAD_METRICS_BROWSER_OBSERVERS_PRERENDER_PAGE_LOAD_METRICS_OBSERVER_H_