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

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

Issue 2111073003: Update PageLoadTiming to use base::Optional (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@optionalbug
Patch Set: fix 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.cc
diff --git a/components/page_load_metrics/browser/page_load_metrics_util.cc b/components/page_load_metrics/browser/page_load_metrics_util.cc
index 96217bf00cd7df8399659dad5f9f67de77ce7a9d..f96a926e4eb216d0b1cd3040570fc6e27a89c2b1 100644
--- a/components/page_load_metrics/browser/page_load_metrics_util.cc
+++ b/components/page_load_metrics/browser/page_load_metrics_util.cc
@@ -29,17 +29,16 @@ bool WasStartedInForegroundOptionalEventInForeground(
event.value() <= info.first_background_time.value());
}
shivanisha 2016/07/07 15:38:57 Can we remove WasStartedInForegroundEventInForegro
Bryan McQuade 2016/07/08 18:39:35 Ah, great, done, thanks!
-bool WasParseInForeground(base::TimeDelta parse_start,
- base::TimeDelta parse_stop,
+bool WasParseInForeground(const base::Optional<base::TimeDelta>& parse_start,
+ const base::Optional<base::TimeDelta>& parse_stop,
const PageLoadExtraInfo& info) {
- if (parse_start.is_zero()) {
+ if (!parse_start) {
return false;
}
- const bool incomplete_parse_in_foreground = parse_stop.is_zero() &&
- info.started_in_foreground &&
- !info.first_background_time;
+ const bool incomplete_parse_in_foreground =
+ !parse_stop && info.started_in_foreground && !info.first_background_time;
return incomplete_parse_in_foreground ||
- WasStartedInForegroundEventInForeground(parse_stop, info);
+ WasStartedInForegroundOptionalEventInForeground(parse_stop, info);
}
} // namespace page_load_metrics

Powered by Google App Engine
This is Rietveld 408576698