| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef COMPONENTS_PAGE_LOAD_METRICS_BROWSER_PAGE_LOAD_METRICS_UTIL_H_ | 5 #ifndef COMPONENTS_PAGE_LOAD_METRICS_BROWSER_PAGE_LOAD_METRICS_UTIL_H_ |
| 6 #define COMPONENTS_PAGE_LOAD_METRICS_BROWSER_PAGE_LOAD_METRICS_UTIL_H_ | 6 #define COMPONENTS_PAGE_LOAD_METRICS_BROWSER_PAGE_LOAD_METRICS_UTIL_H_ |
| 7 | 7 |
| 8 #include "base/metrics/histogram_macros.h" | 8 #include "base/metrics/histogram_macros.h" |
| 9 #include "base/optional.h" | 9 #include "base/optional.h" |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 const PageLoadExtraInfo& info); | 33 const PageLoadExtraInfo& info); |
| 34 | 34 |
| 35 bool WasStartedInForegroundOptionalEventInForeground( | 35 bool WasStartedInForegroundOptionalEventInForeground( |
| 36 const base::Optional<base::TimeDelta>& event, | 36 const base::Optional<base::TimeDelta>& event, |
| 37 const PageLoadExtraInfo& info); | 37 const PageLoadExtraInfo& info); |
| 38 | 38 |
| 39 // Returns true if: | 39 // Returns true if: |
| 40 // - Parse started and did not complete but the entire page load duration | 40 // - Parse started and did not complete but the entire page load duration |
| 41 // happened in the foreground. | 41 // happened in the foreground. |
| 42 // - Parse completed and happened entirely in the foreground. | 42 // - Parse completed and happened entirely in the foreground. |
| 43 bool WasParseInForeground(base::TimeDelta parse_start, | 43 bool WasParseInForeground(const base::Optional<base::TimeDelta>& parse_start, |
| 44 base::TimeDelta parse_stop, | 44 const base::Optional<base::TimeDelta>& parse_stop, |
| 45 const PageLoadExtraInfo& info); | 45 const PageLoadExtraInfo& info); |
| 46 } // namespace page_load_metrics | 46 } // namespace page_load_metrics |
| 47 | 47 |
| 48 #endif // COMPONENTS_PAGE_LOAD_METRICS_BROWSER_PAGE_LOAD_METRICS_UTIL_H_ | 48 #endif // COMPONENTS_PAGE_LOAD_METRICS_BROWSER_PAGE_LOAD_METRICS_UTIL_H_ |
| OLD | NEW |