Index: chrome/browser/page_load_metrics/metrics_web_contents_observer.h |
diff --git a/chrome/browser/page_load_metrics/metrics_web_contents_observer.h b/chrome/browser/page_load_metrics/metrics_web_contents_observer.h |
index a57a65e5963f410332c9f94f0528175069734f9d..7265774332da19cd0cb43b9e1931ce0fa7188e78 100644 |
--- a/chrome/browser/page_load_metrics/metrics_web_contents_observer.h |
+++ b/chrome/browser/page_load_metrics/metrics_web_contents_observer.h |
@@ -11,11 +11,13 @@ |
#include "base/macros.h" |
#include "base/observer_list.h" |
+#include "base/optional.h" |
#include "base/time/time.h" |
#include "chrome/browser/page_load_metrics/page_load_metrics_observer.h" |
#include "chrome/common/page_load_metrics/page_load_metrics.mojom.h" |
#include "chrome/common/page_load_metrics/page_load_timing.h" |
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_data.h" |
+#include "components/ukm/ukm_source.h" |
#include "content/public/browser/render_widget_host.h" |
#include "content/public/browser/web_contents.h" |
#include "content/public/browser/web_contents_binding_set.h" |
@@ -145,6 +147,15 @@ class MetricsWebContentsObserver |
const mojom::PageLoadTiming& timing, |
const mojom::PageLoadMetadata& metadata); |
+ // Gets the Source ID for the load related to |navigation_handle| if it is |
+ // pending, can be empty if the load is not pending. |
+ base::Optional<ukm::SourceId> GetUKMSourceIdForNavigationHandle( |
+ content::NavigationHandle* navigation_handle); |
+ |
+ // Gets the Source ID for the currently committed load if there is a committed |
+ // load. |
+ base::Optional<ukm::SourceId> GetUKMSourceForCommittedLoad(); |
+ |
private: |
friend class content::WebContentsUserData<MetricsWebContentsObserver>; |