OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_RESOURCE_TRACKING_PAGE_LOAD_M ETRICS_OBSERVER_H_ | |
6 #define CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_RESOURCE_TRACKING_PAGE_LOAD_M ETRICS_OBSERVER_H_ | |
7 | |
8 #include <stdint.h> | |
9 | |
10 #include "chrome/browser/page_load_metrics/page_load_metrics_observer.h" | |
11 | |
12 namespace page_load_metrics { | |
13 | |
14 class ResourceTrackingPageLoadMetricsObserver | |
15 : public page_load_metrics::PageLoadMetricsObserver { | |
16 public: | |
17 ResourceTrackingPageLoadMetricsObserver(); | |
18 ~ResourceTrackingPageLoadMetricsObserver() override; | |
19 | |
20 // Called by the PageLoadMetrics framework when we start a new request, so we | |
21 // can update our data structures to be able to calculate a resource done | |
22 // percentage. | |
23 void OnStartedResource( | |
24 const ExtraRequestStartInfo& extra_request_start_info) override; | |
25 | |
26 // Called by the PageLoadMetrics framework when we start a new request, so we | |
27 // can update our data structures to be able to calculate a resource done | |
28 // percentage. | |
29 void OnLoadedResource( | |
30 const ExtraRequestCompleteInfo& extra_request_complete_info) override; | |
31 | |
32 // For the specified type, get the count of requests started and completed. | |
RyanSturm
2017/04/17 19:57:08
Can you update this comment to reflect that |type|
Pete Williamson
2017/04/17 20:46:36
Done.
| |
33 void GetCountsForType(const content::ResourceType type, | |
34 int64_t* started_count, | |
35 int64_t* completed_count); | |
36 | |
37 private: | |
38 // TODO(petewil): Some way to keep track of what we've seen | |
39 // TODO(petewil): Some way to inform our keeper of aggregate results when they | |
40 // change.}; | |
RyanSturm
2017/04/17 19:57:08
nit: s/change.};/change./
Pete Williamson
2017/04/17 20:46:36
Done.
| |
41 int64_t started_count_; | |
42 int64_t completed_count_; | |
43 }; | |
44 | |
45 } // namespace page_load_metrics | |
46 | |
47 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_RESOURCE_TRACKING_PAGE_LOA D_METRICS_OBSERVER_H_ | |
OLD | NEW |