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

Unified Diff: chrome/browser/page_load_metrics/page_load_metrics_util.cc

Issue 2930583002: Add Foreground-to-FirstMeaningfulPaint histogram (Closed)
Patch Set: add FCP variant Created 3 years, 6 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/page_load_metrics/page_load_metrics_util.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/page_load_metrics/page_load_metrics_util.cc
diff --git a/chrome/browser/page_load_metrics/page_load_metrics_util.cc b/chrome/browser/page_load_metrics/page_load_metrics_util.cc
index ab1acc1ded52fdcc6c75c52bf01f18452cb6c8a8..e5f54f3c6f1e7f6ae1a7fdc3c37feb32df3d9a8d 100644
--- a/chrome/browser/page_load_metrics/page_load_metrics_util.cc
+++ b/chrome/browser/page_load_metrics/page_load_metrics_util.cc
@@ -51,6 +51,15 @@ bool WasStartedInForegroundOptionalEventInForeground(
event.value() <= info.first_background_time.value());
}
+bool WasStartedInBackgroundOptionalEventInForeground(
+ const base::Optional<base::TimeDelta>& event,
+ const PageLoadExtraInfo& info) {
+ return !info.started_in_foreground && event && info.first_foreground_time &&
+ info.first_foreground_time.value() <= event.value() &&
+ (!info.first_background_time ||
+ event.value() <= info.first_background_time.value());
+}
+
PageAbortInfo GetPageAbortInfo(const PageLoadExtraInfo& info) {
if (IsBackgroundAbort(info)) {
// Though most cases where a tab is backgrounded are user initiated, we
« no previous file with comments | « chrome/browser/page_load_metrics/page_load_metrics_util.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698