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

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

Issue 2512953002: Prerender: Add FCP histograms to nostate browsertests. (Closed)
Patch Set: 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_manager.cc
diff --git a/chrome/browser/prerender/prerender_manager.cc b/chrome/browser/prerender/prerender_manager.cc
index 090a5539d984ca5aeeb50ab3269dac2aad32dcc5..aa8933f4096e2d5398092f1db90e0915e6a61e47 100644
--- a/chrome/browser/prerender/prerender_manager.cc
+++ b/chrome/browser/prerender/prerender_manager.cc
@@ -615,15 +615,15 @@ void PrerenderManager::RecordNoStateFirstContentfulPaint(const GURL& url,
std::remove_if(prefetches_.begin(), prefetches_.end(),
[url](const NavigationRecord& r) { return r.url == url; }),
prefetches_.end());
-}
-void PrerenderManager::RecordPerceivedFirstContentfulPaint(
- content::WebContents* web_contents,
- base::TimeDelta first_contentful_paint) {
for (auto& observer : observers_) {
observer->OnFirstContentfulPaint();
pasko 2016/11/18 15:56:56 can we notify observers just after recording histo
mattcary 2016/11/18 16:13:27 SGTM. I moved it to the end of the function for a
}
+}
+void PrerenderManager::RecordPerceivedFirstContentfulPaint(
+ content::WebContents* web_contents,
+ base::TimeDelta first_contentful_paint) {
PrerenderTabHelper* tab_helper =
PrerenderTabHelper::FromWebContents(web_contents);
DCHECK(tab_helper);
@@ -638,6 +638,10 @@ void PrerenderManager::RecordPerceivedFirstContentfulPaint(
histograms_->RecordPerceivedFirstContentfulPaintStatus(tab_helper->origin(),
false);
}
+
+ for (auto& observer : observers_) {
pasko 2016/11/18 15:56:56 this moved too, does anything depend on firing it
mattcary 2016/11/18 16:13:27 I moved this to be consistent with the other FCP (
+ observer->OnFirstContentfulPaint();
+ }
}
// static

Powered by Google App Engine
This is Rietveld 408576698