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

Unified Diff: chrome/browser/prerender/prerender_tab_helper.h

Issue 2423383002: [Prerender] first contentful paint histograms. (Closed)
Patch Set: comments Created 4 years, 1 month 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/prerender/prerender_tab_helper.h
diff --git a/chrome/browser/prerender/prerender_tab_helper.h b/chrome/browser/prerender/prerender_tab_helper.h
index 2ded6bf8011420011a4c3b499793aa8c00621490..76bf74fd90fd079dad30d78a2e068fd9ee49a68b 100644
--- a/chrome/browser/prerender/prerender_tab_helper.h
+++ b/chrome/browser/prerender/prerender_tab_helper.h
@@ -52,6 +52,14 @@ class PrerenderTabHelper
// Called when a control prerender is resolved. Applies to the next load.
void WouldHavePrerenderedNextLoad(Origin origin);
+ // Computes the time delta from prerender load start to swapped in time. This
+ // adjustment is the difference between actual load or paint times and
+ // perceived times. Returns false if this is called outside the interval from
+ // swap in to page load.
+ bool LoadToPerceivedDelta(base::TimeDelta* delta);
+
+ Origin origin() const { return origin_; }
+
private:
explicit PrerenderTabHelper(content::WebContents* web_contents);
friend class content::WebContentsUserData<PrerenderTabHelper>;
@@ -97,6 +105,14 @@ class PrerenderTabHelper
// swapped in).
base::TimeTicks actual_load_start_;
+ // Record the most recent load and swap times. These differ from
+ // |pplt_load_start_| and |actual_load_start_| in that they are not reset in
+ // various circumstances, like a load being stopped. There is no guarantee
+ // about their correctness. For example, if a load somehow starts after a
+ // swap, then |last_load_ > last_swap_|.
+ base::TimeTicks last_load_;
+ base::TimeTicks last_swap_;
+
// Current URL being loaded.
GURL url_;

Powered by Google App Engine
This is Rietveld 408576698