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

Unified Diff: chrome/browser/prerender/prerender_manager.cc

Issue 2776713002: Prerender: clarify prerender origin for purposes of FCP histograms. (Closed)
Patch Set: Created 3 years, 9 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
« no previous file with comments | « chrome/browser/prerender/prerender_browsertest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/prerender/prerender_manager.cc
diff --git a/chrome/browser/prerender/prerender_manager.cc b/chrome/browser/prerender/prerender_manager.cc
index 4d9f1adcbf5b3add7ef4b07e474bba16551fddc4..afe65ef76e6510b2105c0dab4129daccee4676ad 100644
--- a/chrome/browser/prerender/prerender_manager.cc
+++ b/chrome/browser/prerender/prerender_manager.cc
@@ -600,21 +600,23 @@ void PrerenderManager::RecordPrerenderFirstContentfulPaint(
DCHECK(tab_helper);
base::TimeDelta prefetch_age;
- // The origin at prefetch is superceeded by the tab_helper origin for the
- // histogram recording, below.
- GetPrefetchInformation(url, &prefetch_age, nullptr);
+ Origin origin;
+ // The tab_helper origin is arguably more accurate, but in order to be
+ // consistent with other prefetch TTFCP histograms, the origin from
+ // GetPrefetchInformation is used instead.
+ GetPrefetchInformation(url, &prefetch_age, &origin);
OnPrefetchUsed(url);
base::TimeTicks swap_ticks = tab_helper->swap_ticks();
bool fcp_recorded = false;
if (!swap_ticks.is_null() && !first_contentful_paint.is_null()) {
pasko 2017/03/24 16:10:30 this is only recorded when swap happened (!swap_ti
mattcary 2017/03/27 07:52:05 Or, it could perhaps be that my logic on the clien
pasko 2017/03/27 17:32:57 Sorry, I misread. We are recording "Reference" wit
histograms_->RecordPrefetchFirstContentfulPaintTime(
- tab_helper->origin(), is_no_store, was_hidden,
- first_contentful_paint - swap_ticks, prefetch_age);
+ origin, is_no_store, was_hidden, first_contentful_paint - swap_ticks,
+ prefetch_age);
fcp_recorded = true;
}
- histograms_->RecordPerceivedFirstContentfulPaintStatus(
- tab_helper->origin(), fcp_recorded, was_hidden);
+ histograms_->RecordPerceivedFirstContentfulPaintStatus(origin, fcp_recorded,
+ was_hidden);
for (auto& observer : observers_) {
observer->OnFirstContentfulPaint();
« no previous file with comments | « chrome/browser/prerender/prerender_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698