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

Unified Diff: components/page_load_metrics/browser/page_load_metrics_util.h

Issue 1507813002: Don't log background navigations in StaleWhileRevalidateExperiment histograms (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make EventOccurredInForeground take a PageLoadExtraInfo object. Created 5 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: components/page_load_metrics/browser/page_load_metrics_util.h
diff --git a/components/page_load_metrics/browser/page_load_metrics_util.h b/components/page_load_metrics/browser/page_load_metrics_util.h
index b5a569867db22bd488ace4ac2009a0f5f3b4a872..0865bfa74aba86297d01cb89c8a785da9b31257b 100644
--- a/components/page_load_metrics/browser/page_load_metrics_util.h
+++ b/components/page_load_metrics/browser/page_load_metrics_util.h
@@ -15,6 +15,7 @@
namespace page_load_metrics {
+struct PageLoadExtraInfo;
struct PageLoadTiming;
// Get the time of the first 'contentful' paint. A contentful paint is a paint
@@ -22,6 +23,14 @@ struct PageLoadTiming;
// Painting of a background color is not considered 'contentful'.
base::TimeDelta GetFirstContentfulPaint(const PageLoadTiming& timing);
+// Returns false for events for which we have no timing information, and events
+// that happened on a page that had been in the background. When a page is
+// backgrounded, some events (e.g. paint) are delayed. Since these data points
+// can skew the mean, they should not be mixed with timing events that occurred
+// in the foreground.
+bool EventOccurredInForeground(const base::TimeDelta& event,
+ const PageLoadExtraInfo& info);
+
} // namespace page_load_metrics
#endif // COMPONENTS_PAGE_LOAD_METRICS_BROWSER_PAGE_LOAD_METRICS_UTIL_H_

Powered by Google App Engine
This is Rietveld 408576698