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

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

Issue 2423383002: [Prerender] first contentful paint histograms. (Closed)
Patch Set: clarify page load metric test 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 ad2a9a835b539172404e1f289a8bd609d2fe55d3..e26cd195f9e9938dcacbffa4aace4f2e4cc71991 100644
--- a/chrome/browser/prerender/prerender_histograms.h
+++ b/chrome/browser/prerender/prerender_histograms.h
@@ -48,6 +48,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.
@@ -117,24 +123,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