chromium/chrome/browser/page_load_metrics/observers/gws_page_load_metrics_observer.cc

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

#include "chrome/browser/page_load_metrics/observers/gws_page_load_metrics_observer.h"

#include <string>

#include "base/metrics/histogram_functions.h"
#include "base/metrics/histogram_macros.h"
#include "base/strings/string_util.h"
#include "base/time/time.h"
#include "base/trace_event/base_tracing.h"
#include "base/trace_event/named_trigger.h"
#include "chrome/browser/after_startup_task_utils.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/page_load_metrics/observers/histogram_suffixes.h"
#include "components/page_load_metrics/browser/navigation_handle_user_data.h"
#include "components/page_load_metrics/browser/observers/core/largest_contentful_paint_handler.h"
#include "components/page_load_metrics/browser/page_load_metrics_util.h"
#include "components/page_load_metrics/common/page_load_timing.h"
#include "components/page_load_metrics/google/browser/gws_abandoned_page_load_metrics_observer.h"
#include "content/public/browser/navigation_handle.h"
#include "services/metrics/public/cpp/ukm_builders.h"
#include "services/metrics/public/cpp/ukm_recorder.h"

PageAbortReason;

namespace internal {

#define HISTOGRAM_PREFIX

const char kHistogramGWSNavigationStartToFinalRequestStart[] =;
const char kHistogramGWSNavigationStartToFinalResponseStart[] =;
const char kHistogramGWSNavigationStartToFinalLoaderCallback[] =;
const char kHistogramGWSNavigationStartToFirstRequestStart[] =;
const char kHistogramGWSNavigationStartToFirstResponseStart[] =;
const char kHistogramGWSNavigationStartToFirstLoaderCallback[] =;
const char kHistogramGWSNavigationStartToOnComplete[] =;

const char kHistogramGWSConnectTimingFirstRequestDomainLookupDelay[] =;
const char kHistogramGWSConnectTimingFirstRequestConnectDelay[] =;
const char kHistogramGWSConnectTimingFirstRequestSslDelay[] =;
const char kHistogramGWSConnectTimingFinalRequestDomainLookupDelay[] =;
const char kHistogramGWSConnectTimingFinalRequestConnectDelay[] =;
const char kHistogramGWSConnectTimingFinalRequestSslDelay[] =;

const char kHistogramGWSAFTEnd[] =;
const char kHistogramGWSAFTStart[] =;
const char kHistogramGWSHeaderChunkStart[] =;
const char kHistogramGWSHeaderChunkEnd[] =;
const char kHistogramGWSBodyChunkStart[] =;
const char kHistogramGWSBodyChunkEnd[] =;
const char kHistogramGWSFirstContentfulPaint[] =;
const char kHistogramGWSLargestContentfulPaint[] =;
const char kHistogramGWSParseStart[] =;
const char kHistogramGWSConnectStart[] =;
const char kHistogramGWSDomainLookupStart[] =;
const char kHistogramGWSDomainLookupEnd[] =;

const char kHistogramGWSHCT[] =;
const char kHistogramGWSSCT[] =;
const char kHistogramGWSTimeBetweenHCTAndSCT[] =;

}  // namespace internal

GWSPageLoadMetricsObserver::GWSPageLoadMetricsObserver() {}

page_load_metrics::PageLoadMetricsObserver::ObservePolicy
GWSPageLoadMetricsObserver::OnStart(
    content::NavigationHandle* navigation_handle,
    const GURL& currently_committed_url,
    bool started_in_foreground) {}

page_load_metrics::PageLoadMetricsObserver::ObservePolicy
GWSPageLoadMetricsObserver::OnCommit(
    content::NavigationHandle* navigation_handle) {}

page_load_metrics::PageLoadMetricsObserver::ObservePolicy
GWSPageLoadMetricsObserver::OnPrerenderStart(
    content::NavigationHandle* navigation_handle,
    const GURL& currently_committed_url) {}

page_load_metrics::PageLoadMetricsObserver::ObservePolicy
GWSPageLoadMetricsObserver::OnFencedFramesStart(
    content::NavigationHandle* navigation_handle,
    const GURL& currently_committed_url) {}

void GWSPageLoadMetricsObserver::OnFirstContentfulPaintInPage(
    const page_load_metrics::mojom::PageLoadTiming& timing) {}

void GWSPageLoadMetricsObserver::OnParseStart(
    const page_load_metrics::mojom::PageLoadTiming& timing) {}

void GWSPageLoadMetricsObserver::OnConnectStart(
    const page_load_metrics::mojom::PageLoadTiming& timing) {}

void GWSPageLoadMetricsObserver::OnDomainLookupStart(
    const page_load_metrics::mojom::PageLoadTiming& timing) {}

void GWSPageLoadMetricsObserver::OnDomainLookupEnd(
    const page_load_metrics::mojom::PageLoadTiming& timing) {}

void GWSPageLoadMetricsObserver::OnComplete(
    const page_load_metrics::mojom::PageLoadTiming& timing) {}

void GWSPageLoadMetricsObserver::OnCustomUserTimingMarkObserved(
    const std::vector<page_load_metrics::mojom::CustomUserTimingMarkPtr>&
        timings) {}

page_load_metrics::PageLoadMetricsObserver::ObservePolicy
GWSPageLoadMetricsObserver::FlushMetricsOnAppEnterBackground(
    const page_load_metrics::mojom::PageLoadTiming& timing) {}

void GWSPageLoadMetricsObserver::LogMetricsOnComplete() {}

void GWSPageLoadMetricsObserver::RecordNavigationTimingHistograms() {}

std::string GWSPageLoadMetricsObserver::AddHistogramSuffix(
    const std::string histogram_name) {}