Chromium Code Reviews| Index: chrome/browser/page_load_metrics/metrics_web_contents_observer.h |
| diff --git a/chrome/browser/page_load_metrics/metrics_web_contents_observer.h b/chrome/browser/page_load_metrics/metrics_web_contents_observer.h |
| index 89c92b8ab8c72b7c0551e3cdf01ee2c4b8b0d639..263fcf09a3ff9def054a331c3146362e9deb7b72 100644 |
| --- a/chrome/browser/page_load_metrics/metrics_web_contents_observer.h |
| +++ b/chrome/browser/page_load_metrics/metrics_web_contents_observer.h |
| @@ -17,6 +17,7 @@ |
| #include "content/public/browser/web_contents.h" |
| #include "content/public/browser/web_contents_observer.h" |
| #include "content/public/browser/web_contents_user_data.h" |
| +#include "content/public/common/resource_type.h" |
| #include "net/base/net_errors.h" |
| #include "third_party/WebKit/public/web/WebInputEvent.h" |
| @@ -156,6 +157,8 @@ class PageLoadTracker { |
| bool UpdateTiming(const PageLoadTiming& timing, |
| const PageLoadMetadata& metadata); |
| + void OnLoadedSubresource(bool was_cached); |
| + |
| // Signals that we should stop tracking metrics for the associated page load. |
| // We may stop tracking a page load if it doesn't meet the criteria for |
| // tracking metrics in DidFinishNavigation. |
| @@ -263,6 +266,12 @@ class PageLoadTracker { |
| ui::PageTransition page_transition_; |
| + // Note: these are only approximations, based on WebContents attribution from |
| + // ResourceRequestInfo objects while this is the currently committed load in |
| + // the WebContents. |
| + int cache_requests_; |
| + int network_requests_; |
|
kinuko
2016/08/09 12:40:37
nit: maybe add num_ or _count
Charlie Harrison
2016/08/09 13:15:44
Done.
|
| + |
| // This is a subtle member. If a provisional load A gets aborted by |
| // provisional load B, which gets aborted by C that eventually commits, then |
| // there exists an abort chain of length 2, starting at A's navigation_start. |
| @@ -318,6 +327,12 @@ class MetricsWebContentsObserver |
| // This method is forwarded from the MetricsNavigationThrottle. |
| void WillStartNavigationRequest(content::NavigationHandle* navigation_handle); |
| + // For definitions of total_received_bytes and raw_body_bytes, see the |
|
kinuko
2016/08/09 12:40:37
nit: stale comments
Charlie Harrison
2016/08/09 13:15:44
Done.
|
| + // associated documentation in url_request.h |
| + void OnRequestComplete(content::ResourceType resource_type, |
| + bool was_cached, |
| + int net_error); |
| + |
| // Flush any buffered metrics, as part of the metrics subsystem persisting |
| // metrics as the application goes into the background. The application may be |
| // killed at any time after this method is invoked without further |