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

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

Issue 2423383002: [Prerender] first contentful paint histograms. (Closed)
Patch Set: Generalize internal histogram function name 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_histograms.h
diff --git a/chrome/browser/prerender/prerender_histograms.h b/chrome/browser/prerender/prerender_histograms.h
index 7fdc187567504a42fc24806be46898132a984016..0bc936b403e177d6d8dbcde2362e561ff905df86 100644
--- a/chrome/browser/prerender/prerender_histograms.h
+++ b/chrome/browser/prerender/prerender_histograms.h
@@ -52,6 +52,21 @@ class PrerenderHistograms {
NavigationType navigation_type,
const GURL& url);
+ // Record perceived first contentful paint time for prerendered pages, the
+ // time from when the user navigates to a page to when it finishes loading.
+ // The actual load may have started prior to navigation due to prerender
+ // hints.
+ void RecordPerceivedFirstContentfulPaintTime(
+ Origin origin,
+ base::TimeDelta perceived_first_contentful_paint,
+ bool was_hidden);
+
+ // 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,26 +136,39 @@ 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).
+ // Records the time to first contentful paint in the context of NoState
+ // Prefetch.
+
+ // Must be called for an actual page load, and 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);
+ void RecordNoStateFirstContentfulPaint(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.
+ // contentful paint for NoState Prefetch.
// Exposed for testing.
- static std::string GetFirstContentfulPaintHistogramName(
+ static std::string GetNoStateFirstContentfulPaintHistogramName(
Origin origin,
bool is_wash,
bool is_no_store,
base::TimeDelta prefetch_age);
private:
+ // Returns the name of the histogram used to record the time to first
+ // contentful paint for Prerender.
+ static std::string GetPerceivedFirstContentfulPaintHistogramName(
+ Origin origin,
+ bool is_wash,
+ bool was_hidden);
+
+ // The suffix used for FCP visibility.
+ static std::string FirstContentfulPaintHiddenName(bool was_hidden);
+
base::TimeTicks GetCurrentTimeTicks() const;
// Returns the time elapsed since the last prerender happened.

Powered by Google App Engine
This is Rietveld 408576698