chromium/chrome/browser/page_load_metrics/observers/page_anchors_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 CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_PAGE_ANCHORS_METRICS_OBSERVER_H_
#define CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_PAGE_ANCHORS_METRICS_OBSERVER_H_

#include "base/memory/raw_ptr.h"
#include "components/page_load_metrics/browser/page_load_metrics_observer.h"
#include "content/public/browser/document_user_data.h"
#include "content/public/browser/render_frame_host.h"

// Tracks anchor information in content::NavigationPredictor to report gathered
// data on navigating out the page. Ideally this should be managed by
// per outermost page manner. However we ensure that this structure is not
// created and accessed during prerendering as we have a DCHECK in
// content::NavigationPredictor::ReportNewAnchorElements. So, we can manage it
// as per WebContents without polluting gathered data.
class PageAnchorsMetricsObserver
    : public page_load_metrics::PageLoadMetricsObserver {};

#endif  // CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_PAGE_ANCHORS_METRICS_OBSERVER_H_