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/time/time.h" | 9 #include "base/time/time.h" |
10 | 10 |
(...skipping 10 matching lines...) Expand all Loading... |
21 // Returns true if: | 21 // Returns true if: |
22 // - We have timing information for the event. | 22 // - We have timing information for the event. |
23 // - The page load started while the page was in the foreground. | 23 // - The page load started while the page was in the foreground. |
24 // - The event occurred prior to the page being moved to the background. | 24 // - The event occurred prior to the page being moved to the background. |
25 // When a page is backgrounded, some events (e.g. paint) are delayed. Since | 25 // When a page is backgrounded, some events (e.g. paint) are delayed. Since |
26 // these data points can skew the mean, they should not be mixed with timing | 26 // these data points can skew the mean, they should not be mixed with timing |
27 // events that occurred in the foreground. | 27 // events that occurred in the foreground. |
28 bool WasStartedInForegroundEventInForeground(base::TimeDelta event, | 28 bool WasStartedInForegroundEventInForeground(base::TimeDelta event, |
29 const PageLoadExtraInfo& info); | 29 const PageLoadExtraInfo& info); |
30 | 30 |
| 31 // Returns true if: |
| 32 // - Parse started and did not complete but the entire page load duration |
| 33 // happened in the foreground. |
| 34 // - Parse completed and happened entirely in the foreground. |
| 35 bool WasParseInForeground(base::TimeDelta parse_start, |
| 36 base::TimeDelta parse_stop, |
| 37 const PageLoadExtraInfo& info); |
| 38 |
31 } // namespace page_load_metrics | 39 } // namespace page_load_metrics |
32 | 40 |
33 #endif // COMPONENTS_PAGE_LOAD_METRICS_BROWSER_PAGE_LOAD_METRICS_UTIL_H_ | 41 #endif // COMPONENTS_PAGE_LOAD_METRICS_BROWSER_PAGE_LOAD_METRICS_UTIL_H_ |
OLD | NEW |