#include "components/page_load_metrics/browser/observers/back_forward_cache_page_load_metrics_observer.h"
#include "base/metrics/histogram_functions.h"
#include "base/time/default_tick_clock.h"
#include "base/time/time.h"
#include "components/page_load_metrics/browser/observers/core/uma_page_load_metrics_observer.h"
#include "components/page_load_metrics/browser/page_load_metrics_util.h"
#include "components/page_load_metrics/browser/responsiveness_metrics_normalization.h"
#include "components/page_load_metrics/common/page_visit_final_status.h"
#include "content/public/browser/navigation_handle.h"
#include "content/public/browser/web_contents.h"
#include "services/metrics/public/cpp/metrics_utils.h"
#include "services/metrics/public/cpp/ukm_builders.h"
#include "third_party/blink/public/common/features.h"
PageVisitFinalStatus;
namespace internal {
const char kHistogramFirstPaintAfterBackForwardCacheRestore[] = …;
const char kHistogramFirstRequestAnimationFrameAfterBackForwardCacheRestore[] = …;
const char kHistogramSecondRequestAnimationFrameAfterBackForwardCacheRestore[] = …;
const char kHistogramThirdRequestAnimationFrameAfterBackForwardCacheRestore[] = …;
const char kHistogramFirstInputDelayAfterBackForwardCacheRestore[] = …;
extern const char
kHistogramCumulativeShiftScoreMainFrameAfterBackForwardCacheRestore[] = …;
extern const char kHistogramCumulativeShiftScoreAfterBackForwardCacheRestore[] = …;
const char kNumInteractions_AfterBackForwardCacheRestore[] = …;
const char
kUserInteractionLatencyHighPercentile2_MaxEventDuration_AfterBackForwardCacheRestore
[] = …;
const char
kWorstUserInteractionLatency_MaxEventDuration_AfterBackForwardCacheRestore
[] = …;
BASE_FEATURE(…);
}
BackForwardCachePageLoadMetricsObserver::
BackForwardCachePageLoadMetricsObserver() = default;
BackForwardCachePageLoadMetricsObserver::
~BackForwardCachePageLoadMetricsObserver() { … }
page_load_metrics::PageLoadMetricsObserver::ObservePolicy
BackForwardCachePageLoadMetricsObserver::OnStart(
content::NavigationHandle* navigation_handle,
const GURL& currently_committed_url,
bool started_in_foreground) { … }
page_load_metrics::PageLoadMetricsObserver::ObservePolicy
BackForwardCachePageLoadMetricsObserver::OnFencedFramesStart(
content::NavigationHandle* navigation_handle,
const GURL& currently_committed_url) { … }
page_load_metrics::PageLoadMetricsObserver::ObservePolicy
BackForwardCachePageLoadMetricsObserver::OnPrerenderStart(
content::NavigationHandle* navigation_handle,
const GURL& currently_committed_url) { … }
page_load_metrics::PageLoadMetricsObserver::ObservePolicy
BackForwardCachePageLoadMetricsObserver::OnHidden(
const page_load_metrics::mojom::PageLoadTiming& timing) { … }
page_load_metrics::PageLoadMetricsObserver::ObservePolicy
BackForwardCachePageLoadMetricsObserver::OnEnterBackForwardCache(
const page_load_metrics::mojom::PageLoadTiming& timing) { … }
void BackForwardCachePageLoadMetricsObserver::OnRestoreFromBackForwardCache(
const page_load_metrics::mojom::PageLoadTiming& timing,
content::NavigationHandle* navigation_handle) { … }
page_load_metrics::PageLoadMetricsObserver::ObservePolicy
BackForwardCachePageLoadMetricsObserver::ShouldObserveMimeType(
const std::string& mime_type) const { … }
void BackForwardCachePageLoadMetricsObserver::
OnFirstPaintAfterBackForwardCacheRestoreInPage(
const page_load_metrics::mojom::BackForwardCacheTiming& timing,
size_t index) { … }
void BackForwardCachePageLoadMetricsObserver::
OnRequestAnimationFramesAfterBackForwardCacheRestoreInPage(
const page_load_metrics::mojom::BackForwardCacheTiming& timing,
size_t index) { … }
void BackForwardCachePageLoadMetricsObserver::
OnFirstInputAfterBackForwardCacheRestoreInPage(
const page_load_metrics::mojom::BackForwardCacheTiming& timing,
size_t index) { … }
page_load_metrics::PageLoadMetricsObserver::ObservePolicy
BackForwardCachePageLoadMetricsObserver::FlushMetricsOnAppEnterBackground(
const page_load_metrics::mojom::PageLoadTiming& timing) { … }
void BackForwardCachePageLoadMetricsObserver::OnComplete(
const page_load_metrics::mojom::PageLoadTiming& timing) { … }
void BackForwardCachePageLoadMetricsObserver::RecordMetricsOnPageVisitEnd(
const page_load_metrics::mojom::PageLoadTiming& timing,
bool app_entering_background) { … }
void BackForwardCachePageLoadMetricsObserver::
MaybeRecordNormalizedResponsivenessMetrics() { … }
void BackForwardCachePageLoadMetricsObserver::
MaybeRecordLayoutShiftScoreAfterBackForwardCacheRestore(
const page_load_metrics::mojom::PageLoadTiming& timing) { … }
void BackForwardCachePageLoadMetricsObserver::
MaybeRecordPageEndAfterBackForwardCacheRestore(
bool app_entering_background) { … }
void BackForwardCachePageLoadMetricsObserver::
MaybeRecordForegroundDurationAfterBackForwardCacheRestore(
const base::TickClock* clock,
bool app_entering_background) const { … }
int64_t BackForwardCachePageLoadMetricsObserver::
GetUkmSourceIdForBackForwardCacheRestore(size_t index) const { … }
int64_t BackForwardCachePageLoadMetricsObserver::
GetLastUkmSourceIdForBackForwardCacheRestore() const { … }