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

Unified Diff: chrome/browser/page_load_metrics/metrics_web_contents_observer.h

Issue 2218583002: [page_load_metrics] Log cache warmth ratios at parse stop (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove byte level data Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698