Chromium Code Reviews| 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 dbfa35ebad04390d702be6642f8a546ce3715e76..9cacbf04f4e04e475ba17e1c4d1f7508b014412a 100644 |
| --- a/components/page_load_metrics/browser/page_load_metrics_util.cc |
| +++ b/components/page_load_metrics/browser/page_load_metrics_util.cc |
| @@ -11,11 +11,27 @@ |
| namespace page_load_metrics { |
| -bool WasStartedInForegroundEventInForeground(base::TimeDelta event, |
| +bool WasStartedInForegroundEventInForeground(const base::TimeDelta& event, |
| const PageLoadExtraInfo& info) { |
| return info.started_in_foreground && !event.is_zero() && |
| (info.first_background_time.is_zero() || |
| event < info.first_background_time); |
| } |
| +bool ParseInForeground(const base::TimeDelta& parse_start, |
| + const base::TimeDelta& parse_stop, |
| + const PageLoadExtraInfo& info) { |
| + if (parse_start.is_zero()) { |
| + return false; |
| + } |
| + // If the parse did not complete but the entire page load duration happened |
| + // in the foreground, or if the parse completed and happened entirely in the |
| + // foreground, record a foreground histogram. |
| + const bool incomplete_parse_in_foreground = |
| + parse_stop.is_zero() && info.started_in_foreground && |
| + info.first_background_time.is_zero(); |
| + |
| + return (incomplete_parse_in_foreground || |
| + WasStartedInForegroundEventInForeground(parse_stop, info)); |
|
jkarlin
2016/04/26 20:16:21
No need for extra parens
shivanisha
2016/04/27 13:34:33
removed extra parens.
|
| +} |
| } // namespace page_load_metrics |