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

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: Need to add Optional changes as well in this issue otherwise bots fail in compilation Created 4 years, 9 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 380c077d26357ae6db44339bbbdacfe9b45692b6..8ffdf4e8a8e651f4aa17ff8dfab5d385475463dd 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,18 @@ 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.
-bool WasStartedInForegroundEventInForeground(base::TimeDelta event,
+bool WasStartedInForegroundEventInForeground(const base::TimeDelta& event,
const PageLoadExtraInfo& info);
+// TODO (@shivanisha) Since the above function is currently also called for
+// TimeDelta coming over IPC (PageLoadTiming) and since Optional is not
+// currently supported in IPC, thus creating another function.
+// They should ideally converge to one function in the future
+// when serialization framework supports Optional
+bool WasStartedInForegroundOptionalEventInForeground(
+ const base::Optional<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