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 #include "components/page_load_metrics/browser/page_load_metrics_observer.h" | |
10 | 11 |
11 #define PAGE_LOAD_HISTOGRAM(name, sample) \ | 12 #define PAGE_LOAD_HISTOGRAM(name, sample) \ |
12 UMA_HISTOGRAM_CUSTOM_TIMES(name, sample, \ | 13 UMA_HISTOGRAM_CUSTOM_TIMES(name, sample, \ |
13 base::TimeDelta::FromMilliseconds(10), \ | 14 base::TimeDelta::FromMilliseconds(10), \ |
14 base::TimeDelta::FromMinutes(10), 100) | 15 base::TimeDelta::FromMinutes(10), 100) |
15 | 16 |
16 namespace page_load_metrics { | 17 namespace page_load_metrics { |
17 | 18 |
18 struct PageLoadTiming; | 19 struct PageLoadTiming; |
19 | 20 |
20 // Get the time of the first 'contentful' paint. A contentful paint is a paint | 21 // Get the time of the first 'contentful' paint. A contentful paint is a paint |
21 // that includes content of some kind (for example, text or image content). | 22 // that includes content of some kind (for example, text or image content). |
22 // Painting of a background color is not considered 'contentful'. | 23 // Painting of a background color is not considered 'contentful'. |
23 base::TimeDelta GetFirstContentfulPaint(const PageLoadTiming& timing); | 24 base::TimeDelta GetFirstContentfulPaint(const PageLoadTiming& timing); |
24 | 25 |
26 // Returns a TimeDelta which is infinity if we were never backgrounded. This is | |
27 // a helper function to help with simpler metric comparisons. | |
28 base::TimeDelta GetBackgroundDelta(const PageLoadExtraInfo& info); | |
kinuko
2015/12/09 04:57:51
nit: I feel the method name and comment are a bit
Charlie Harrison
2015/12/09 22:46:43
Good point. ricea is fixing this in his CL here
ht
| |
29 | |
25 } // namespace page_load_metrics | 30 } // namespace page_load_metrics |
26 | 31 |
27 #endif // COMPONENTS_PAGE_LOAD_METRICS_BROWSER_PAGE_LOAD_METRICS_UTIL_H_ | 32 #endif // COMPONENTS_PAGE_LOAD_METRICS_BROWSER_PAGE_LOAD_METRICS_UTIL_H_ |
OLD | NEW |