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

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

Issue 1837233002: Optional <TimeDelta> since they may be non existent. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: added dcheck when isHighResolution is true. Created 4 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
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 c79612e2a32672bf2b69be034c65cce48af2839d..66dc3aa7119f2cfc5dbba22b6032092d94ce1a78 100644
--- a/components/page_load_metrics/browser/page_load_metrics_util.h
+++ b/components/page_load_metrics/browser/page_load_metrics_util.h
@@ -6,6 +6,7 @@
#define COMPONENTS_PAGE_LOAD_METRICS_BROWSER_PAGE_LOAD_METRICS_UTIL_H_
#include "base/metrics/histogram_macros.h"
+#include "base/optional.h"
#include "base/time/time.h"
#define PAGE_LOAD_HISTOGRAM(name, sample) \
@@ -25,9 +26,16 @@ struct PageLoadTiming;
// 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.
+// If the event time delta and background time delta are equal, we still
+// consider the event to be logged in the foreground histogram since any
+// background specific handling would not yet have been applied to that event.
bool WasStartedInForegroundEventInForeground(base::TimeDelta event,
const PageLoadExtraInfo& info);
+bool WasStartedInForegroundOptionalEventInForeground(
+ const base::Optional<base::TimeDelta>& event,
+ const PageLoadExtraInfo& info);
+
// Returns true if:
// - Parse started and did not complete but the entire page load duration
// happened in the foreground.
@@ -35,7 +43,6 @@ bool WasStartedInForegroundEventInForeground(base::TimeDelta event,
bool WasParseInForeground(base::TimeDelta parse_start,
base::TimeDelta parse_stop,
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