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

Side by Side Diff: chrome/browser/page_load_metrics/page_load_metrics_util.h

Issue 2737563007: Add support for tracking loading behavior of child frames. (Closed)
Patch Set: stop observing if started in background Created 3 years, 9 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 unified diff | Download patch
OLDNEW
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 CHROME_BROWSER_PAGE_LOAD_METRICS_PAGE_LOAD_METRICS_UTIL_H_ 5 #ifndef CHROME_BROWSER_PAGE_LOAD_METRICS_PAGE_LOAD_METRICS_UTIL_H_
6 #define CHROME_BROWSER_PAGE_LOAD_METRICS_PAGE_LOAD_METRICS_UTIL_H_ 6 #define CHROME_BROWSER_PAGE_LOAD_METRICS_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"
11 #include "chrome/browser/page_load_metrics/page_load_metrics_observer.h" 11 #include "chrome/browser/page_load_metrics/page_load_metrics_observer.h"
12 #include "third_party/WebKit/public/platform/WebLoadingBehaviorFlag.h"
12 13
13 // Up to 10 minutes, with 100 buckets. 14 // Up to 10 minutes, with 100 buckets.
14 #define PAGE_LOAD_HISTOGRAM(name, sample) \ 15 #define PAGE_LOAD_HISTOGRAM(name, sample) \
15 UMA_HISTOGRAM_CUSTOM_TIMES(name, sample, \ 16 UMA_HISTOGRAM_CUSTOM_TIMES(name, sample, \
16 base::TimeDelta::FromMilliseconds(10), \ 17 base::TimeDelta::FromMilliseconds(10), \
17 base::TimeDelta::FromMinutes(10), 100) 18 base::TimeDelta::FromMinutes(10), 100)
18 19
19 // Up to 1 hour, with 100 buckets. 20 // Up to 1 hour, with 100 buckets.
20 #define PAGE_LOAD_LONG_HISTOGRAM(name, sample) \ 21 #define PAGE_LOAD_LONG_HISTOGRAM(name, sample) \
21 UMA_HISTOGRAM_CUSTOM_TIMES(name, sample, \ 22 UMA_HISTOGRAM_CUSTOM_TIMES(name, sample, \
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 const PageLoadExtraInfo& info, 118 const PageLoadExtraInfo& info,
118 base::TimeTicks app_background_time); 119 base::TimeTicks app_background_time);
119 120
120 // Returns the minimum value of the optional TimeDeltas, if both values are 121 // Returns the minimum value of the optional TimeDeltas, if both values are
121 // set. Otherwise, if one value is set, returns that value. Otherwise, returns 122 // set. Otherwise, if one value is set, returns that value. Otherwise, returns
122 // an unset value. 123 // an unset value.
123 base::Optional<base::TimeDelta> OptionalMin( 124 base::Optional<base::TimeDelta> OptionalMin(
124 const base::Optional<base::TimeDelta>& a, 125 const base::Optional<base::TimeDelta>& a,
125 const base::Optional<base::TimeDelta>& b); 126 const base::Optional<base::TimeDelta>& b);
126 127
128 // Whether the given loading behavior was observed in any frame (either the main
129 // frame or a child frame).
130 bool DidObserveLoadingBehaviorInAnyFrame(
131 const page_load_metrics::PageLoadExtraInfo& info,
132 blink::WebLoadingBehaviorFlag behavior);
133
127 } // namespace page_load_metrics 134 } // namespace page_load_metrics
128 135
129 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_PAGE_LOAD_METRICS_UTIL_H_ 136 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_PAGE_LOAD_METRICS_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698