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

Side by Side Diff: chrome/browser/page_load_metrics/observers/resource_tracking_page_load_metrics_observer.h

Issue 2780003003: Send an event to the page load metrics to track resource starting. (Closed)
Patch Set: Fix browser tests Created 3 years, 8 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
(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 "chrome/browser/page_load_metrics/page_load_metrics_observer.h"
9
10 namespace page_load_metrics {
11
12 class ResourceTrackingPageLoadMetricsObserver
13 : public page_load_metrics::PageLoadMetricsObserver {
14 public:
15 ResourceTrackingPageLoadMetricsObserver();
16 ~ResourceTrackingPageLoadMetricsObserver() override;
17
18 // Called by the PageLoadMetrics framework when we start a new request, so we
19 // can update our data structures to be able to calculate a resource done
20 // percentage.
21 void OnStartedResource(
22 const ExtraRequestStartInfo& extra_request_start_info) override;
23
24 // Called by the PageLoadMetrics framework when we start a new request, so we
25 // can update our data structures to be able to calculate a resource done
26 // percentage.
27 void OnLoadedResource(
28 const ExtraRequestCompleteInfo& extra_request_complete_info) override;
29
30 // For the specified type, get the count of requests started and completed.
31 void GetCountsForType(const content::ResourceType type,
32 int64_t& started_count,
RyanSturm 2017/04/14 20:08:43 #include <stdint.h>
Pete Williamson 2017/04/17 18:53:11 Done.
33 int64_t& completed_count);
34
35 private:
36 // TODO: Some way to keep track of what we've seen
37 // TODO: Some way to inform our keeper of aggregate results when they
38 // change.};
39 int64_t started_count_;
40 int64_t completed_count_;
41 };
42
43 } // namespace page_load_metrics
44
45 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_RESOURCE_TRACKING_PAGE_LOA D_METRICS_OBSERVER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698