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

Unified Diff: chrome/browser/page_load_metrics/page_load_tracker.h

Issue 2692373003: Refactor PageLoadExtraInfo::committed_url to url and did_commit fields. (Closed)
Patch Set: address comments Created 3 years, 10 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
Index: chrome/browser/page_load_metrics/page_load_tracker.h
diff --git a/chrome/browser/page_load_metrics/page_load_tracker.h b/chrome/browser/page_load_metrics/page_load_tracker.h
index d12324a22eb944e738dd42335a866e64484a1878..ef782b2a6406e91f60814b8ad272c4a4eae62d77 100644
--- a/chrome/browser/page_load_metrics/page_load_tracker.h
+++ b/chrome/browser/page_load_metrics/page_load_tracker.h
@@ -198,11 +198,8 @@ class PageLoadTracker {
bool MatchesOriginalNavigation(content::NavigationHandle* navigation_handle);
- // Only valid to call post-commit.
- const GURL& committed_url() const {
- DCHECK(!committed_url_.is_empty());
- return committed_url_;
- }
+ bool did_commit() const { return did_commit_; }
+ const GURL& url() const { return url_; }
base::TimeTicks navigation_start() const { return navigation_start_; }
@@ -241,6 +238,8 @@ class PageLoadTracker {
// committed load.
void LogAbortChainHistograms(content::NavigationHandle* final_navigation);
+ void MaybeUpdateURL(content::NavigationHandle* navigation_handle);
+
UserInputTracker input_tracker_;
// Whether we stopped tracking this navigation after it was initiated. We may
@@ -255,12 +254,16 @@ class PageLoadTracker {
// The navigation start in TimeTicks, not the wall time reported by Blink.
const base::TimeTicks navigation_start_;
- // The committed URL of this page load.
- GURL committed_url_;
+ // The most recent URL of this page load. Updated at navigation start, upon
+ // redirection, and at commit time.
+ GURL url_;
// The start URL for this page load (before redirects).
GURL start_url_;
+ // Whether this page load committed.
+ bool did_commit_;
+
std::unique_ptr<FailedProvisionalLoadInfo> failed_provisional_load_info_;
// Will be ABORT_NONE if we have not aborted this load yet. Otherwise will
« no previous file with comments | « chrome/browser/page_load_metrics/page_load_metrics_observer.cc ('k') | chrome/browser/page_load_metrics/page_load_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698