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

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

Issue 2423383002: [Prerender] first contentful paint histograms. (Closed)
Patch Set: comments Created 4 years 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_histograms.h
diff --git a/chrome/browser/prerender/prerender_histograms.h b/chrome/browser/prerender/prerender_histograms.h
index 7fdc187567504a42fc24806be46898132a984016..ef6381e63a47790f78978d6af8e3b0cd0fc9175c 100644
--- a/chrome/browser/prerender/prerender_histograms.h
+++ b/chrome/browser/prerender/prerender_histograms.h
@@ -52,6 +52,12 @@ class PrerenderHistograms {
NavigationType navigation_type,
const GURL& url);
+ // Record that a first contentful paint occured, and whether we were able to
+ // successfuly record the perceived FCP.
+ void RecordPerceivedFirstContentfulPaintStatus(Origin origin,
+ bool successful,
+ bool was_hidden);
+
// Records, in a histogram, the percentage of the page load time that had
// elapsed by the time it is swapped in. Values outside of [0, 1.0] are
// invalid and ignored.
@@ -121,24 +127,17 @@ class PrerenderHistograms {
bool is_main_resource,
int redirect_count) const;
- // Records the time to first contentful paint.
- // Must not be called for prefetch loads (which are never rendered anyway).
- // |is_no_store| must be true if the main resource has a "no-store" cache
- // control HTTP header.
- // |prefetch_age| must be zero if the page was not prefetched.
- void RecordFirstContentfulPaint(Origin origin,
- bool is_no_store,
- base::TimeDelta time,
- base::TimeDelta prefetch_age);
-
- // Returns the name of the histogram used to record the time to first
- // contentful paint.
- // Exposed for testing.
- static std::string GetFirstContentfulPaintHistogramName(
- Origin origin,
- bool is_wash,
- bool is_no_store,
- base::TimeDelta prefetch_age);
+ // Records the time to first contentful paint with respect to a possible
+ // prefetch of the page. The time to first contentful paint with respect to
+ // the navigation start is recorded (even if the page was prererendered in
+ // advance of navigation start). One of several histograms is used, depending
+ // on whether this URL could have been prefetched before the navigation
+ // leading to the paint.
+ void RecordPrefetchFirstContentfulPaintTime(Origin origin,
+ bool is_no_store,
+ bool was_hidden,
+ base::TimeDelta time,
+ base::TimeDelta prefetch_age);
private:
base::TimeTicks GetCurrentTimeTicks() const;

Powered by Google App Engine
This is Rietveld 408576698