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

Unified Diff: chrome/browser/predictors/resource_prefetch_predictor.h

Issue 2755093002: predictors: Mark before_first_contentful_paint for resources fetched before fcp. (Closed)
Patch Set: before_first_contentful_paint browser_test Created 3 years, 8 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
Index: chrome/browser/predictors/resource_prefetch_predictor.h
diff --git a/chrome/browser/predictors/resource_prefetch_predictor.h b/chrome/browser/predictors/resource_prefetch_predictor.h
index fa4469ca1a0ab332e50b5349fa0d697714adce60..6b17f8326857f36276d6cc21943b467d0a6b3bf3 100644
--- a/chrome/browser/predictors/resource_prefetch_predictor.h
+++ b/chrome/browser/predictors/resource_prefetch_predictor.h
@@ -132,6 +132,8 @@ class ResourcePrefetchPredictor
GURL request_url; // URL after all redirects.
content::ResourceType resource_type;
net::RequestPriority priority;
+ base::TimeTicks response_time;
+ bool before_first_contentful_paint;
// Only for responses.
std::string mime_type;
@@ -158,6 +160,7 @@ class ResourcePrefetchPredictor
GURL main_frame_url;
GURL initial_url;
+ base::TimeTicks first_contentful_paint;
// Stores all subresource requests within a single navigation, from initial
// main frame request to navigation completion.
@@ -228,6 +231,11 @@ class ResourcePrefetchPredictor
// Called when the main frame of a page completes loading.
void RecordMainFrameLoadComplete(const NavigationID& navigation_id);
+ // Called after the main frame's first contentful paint.
+ void RecordFirstContentfulPaint(
+ const NavigationID& navigation_id,
+ const base::TimeTicks& first_contentful_paint);
+
// Starts prefetching if it is enabled for |origin| and prefetching data
// exists for the |main_frame_url| either at the URL or at the host level.
void StartPrefetching(const GURL& main_frame_url, PrefetchOrigin origin);

Powered by Google App Engine
This is Rietveld 408576698