Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(326)

Unified Diff: components/page_load_metrics/browser/metrics_web_contents_observer.h

Issue 1879413002: Provide currently_committed_url to PageLoadMetricsObservers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | components/page_load_metrics/browser/metrics_web_contents_observer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/page_load_metrics/browser/metrics_web_contents_observer.h
diff --git a/components/page_load_metrics/browser/metrics_web_contents_observer.h b/components/page_load_metrics/browser/metrics_web_contents_observer.h
index 14aec6712ed0f678efdeaab2aaf07a4714363a5c..f18b126d4940c1e9afdbc3e679f2d4df1d705a5c 100644
--- a/components/page_load_metrics/browser/metrics_web_contents_observer.h
+++ b/components/page_load_metrics/browser/metrics_web_contents_observer.h
@@ -106,9 +106,12 @@ class PageLoadMetricsEmbedderInterface {
class PageLoadTracker {
public:
// Caller must guarantee that the embedder_interface pointer outlives this
- // class.
+ // class. The PageLoadTracker must not hold on to
+ // currently_committed_load_or_null or navigation_handle beyond the scope of
+ // the constructor.
PageLoadTracker(bool in_foreground,
PageLoadMetricsEmbedderInterface* embedder_interface,
+ PageLoadTracker* const currently_committed_load_or_null,
content::NavigationHandle* navigation_handle,
int aborted_chain_size,
int aborted_chain_size_same_url);
@@ -122,7 +125,6 @@ class PageLoadTracker {
// Returns true if the timing was successfully updated.
bool UpdateTiming(const PageLoadTiming& timing,
const PageLoadMetadata& metadata);
- bool HasBackgrounded();
void set_renderer_tracked(bool renderer_tracked);
bool renderer_tracked() const { return renderer_tracked_; }
@@ -152,12 +154,15 @@ class PageLoadTracker {
bool MatchesOriginalNavigation(content::NavigationHandle* navigation_handle);
+ // Only valid to call post-commit.
+ const GURL& committed_url() const {
+ DCHECK(!commit_time_.is_null());
+ return url_;
+ }
+
private:
PageLoadExtraInfo GetPageLoadMetricsInfo();
- // Only valid to call post-commit.
- const GURL& committed_url();
-
void UpdateAbortInternal(UserAbortType abort_type,
base::TimeTicks timestamp);
« no previous file with comments | « no previous file | components/page_load_metrics/browser/metrics_web_contents_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698