#include "components/page_load_metrics/browser/observers/privacy_sandbox_ads_page_load_metrics_observer.h"
#include <optional>
#include <vector>
#include "base/metrics/histogram_functions.h"
#include "base/strings/strcat.h"
#include "base/time/time.h"
#include "components/page_load_metrics/browser/observers/core/largest_contentful_paint_handler.h"
#include "components/page_load_metrics/browser/page_load_metrics_observer.h"
#include "components/page_load_metrics/browser/page_load_metrics_observer_delegate.h"
#include "components/page_load_metrics/browser/page_load_metrics_observer_interface.h"
#include "components/page_load_metrics/browser/page_load_metrics_util.h"
#include "third_party/blink/public/mojom/use_counter/metrics/web_feature.mojom.h"
#include "third_party/blink/public/mojom/use_counter/use_counter_feature.mojom.h"
namespace {
FeatureType;
WebFeature;
constexpr char kHistogramPrivacySandboxAdsFirstInputDelay4Prefix[] = …;
constexpr char
kHistogramPrivacySandboxAdsNavigationToFirstContentfulPaintPrefix[] = …;
constexpr char
kHistogramPrivacySandboxAdsNavigationToLargestContentfulPaint2Prefix[] = …;
constexpr char kHistogramPrivacySandboxAdsMaxCumulativeShiftScorePrefix[] = …;
}
std::string PrivacySandboxAdsPageLoadMetricsObserver::GetHistogramName(
const char* prefix,
PrivacySandboxAdsApi api) { … }
const char* PrivacySandboxAdsPageLoadMetricsObserver::GetObserverName() const { … }
page_load_metrics::PageLoadMetricsObserver::ObservePolicy
PrivacySandboxAdsPageLoadMetricsObserver::OnFencedFramesStart(
content::NavigationHandle* navigation_handle,
const GURL& currently_committed_url) { … }
page_load_metrics::PageLoadMetricsObserver::ObservePolicy
PrivacySandboxAdsPageLoadMetricsObserver::OnPrerenderStart(
content::NavigationHandle* navigation_handle,
const GURL& currently_committed_url) { … }
void PrivacySandboxAdsPageLoadMetricsObserver::OnFirstInputInPage(
const page_load_metrics::mojom::PageLoadTiming& timing) { … }
void PrivacySandboxAdsPageLoadMetricsObserver::OnFirstContentfulPaintInPage(
const page_load_metrics::mojom::PageLoadTiming& timing) { … }
void PrivacySandboxAdsPageLoadMetricsObserver::OnComplete(
const page_load_metrics::mojom::PageLoadTiming& timing) { … }
page_load_metrics::PageLoadMetricsObserver::ObservePolicy
PrivacySandboxAdsPageLoadMetricsObserver::FlushMetricsOnAppEnterBackground(
const page_load_metrics::mojom::PageLoadTiming& timing) { … }
void PrivacySandboxAdsPageLoadMetricsObserver::OnFeaturesUsageObserved(
content::RenderFrameHost* rfh,
const std::vector<blink::UseCounterFeature>& features) { … }
void PrivacySandboxAdsPageLoadMetricsObserver::RecordSessionEndHistograms(
const page_load_metrics::mojom::PageLoadTiming& main_frame_timing) { … }