Index: chrome/browser/page_load_metrics/page_load_metrics_observer.h |
diff --git a/chrome/browser/page_load_metrics/page_load_metrics_observer.h b/chrome/browser/page_load_metrics/page_load_metrics_observer.h |
index 41acd9cd0f165b1e0b712c63f3a74a0f2e658d18..52522e51f82e760c7694b594ca701ac8f1540b1c 100644 |
--- a/chrome/browser/page_load_metrics/page_load_metrics_observer.h |
+++ b/chrome/browser/page_load_metrics/page_load_metrics_observer.h |
@@ -12,6 +12,7 @@ |
#include "chrome/common/page_load_metrics/page_load_timing.h" |
#include "content/public/browser/navigation_handle.h" |
#include "content/public/browser/web_contents_observer.h" |
+#include "content/public/common/resource_type.h" |
#include "third_party/WebKit/public/platform/WebInputEvent.h" |
#include "url/gurl.h" |
@@ -197,27 +198,35 @@ struct PageLoadExtraInfo { |
// Container for various information about a request within a page load. |
struct ExtraRequestInfo { |
- ExtraRequestInfo(bool was_cached, |
+ ExtraRequestInfo(const GURL& url, |
+ int frame_tree_node_id, |
+ bool was_cached, |
int64_t raw_body_bytes, |
bool data_reduction_proxy_used, |
int64_t original_network_content_length); |
ExtraRequestInfo(const ExtraRequestInfo& other); |
- |
+ ExtraRequestInfo& operator=(const ExtraRequestInfo& other); |
~ExtraRequestInfo(); |
+ // The URL for the request. |
+ GURL url; |
+ |
+ // The frame tree node id that initiated the request. |
+ int frame_tree_node_id; |
+ |
// True if the resource was loaded from cache. |
- const bool was_cached; |
+ bool was_cached; |
// The number of body (not header) prefilter bytes. |
- const int64_t raw_body_bytes; |
+ int64_t raw_body_bytes; |
// Whether this request used Data Reduction Proxy. |
- const bool data_reduction_proxy_used; |
+ bool data_reduction_proxy_used; |
// The number of body (not header) bytes that the data reduction proxy saw |
// before it compressed the requests. |
- const int64_t original_network_content_length; |
+ int64_t original_network_content_length; |
}; |
// Interface for PageLoadMetrics observers. All instances of this class are |
@@ -261,6 +270,17 @@ class PageLoadMetricsObserver { |
// callbacks, and will be deleted after invocation of this method returns. |
virtual ObservePolicy OnCommit(content::NavigationHandle* navigation_handle); |
+ // OnCommitSubFrame is triggered when the a sub-frame of the committed page |
+ // is committed. The navigation handle holds relevant data for the |
+ // navigation, but will be destroyed soon after this call. Don't hold a |
+ // reference to it. |
+ // Unlike the main frame, OnCommitSubFrame does not filter by |
+ // PageTrackDecider::ShouldTrack. This means that data URIs, network error |
+ // pages, and non-html documents will result in OnCommitSubFrame being |
+ // called. |
+ virtual ObservePolicy OnCommitSubFrame( |
+ content::NavigationHandle* navigation_handle); |
+ |
// OnHidden is triggered when a page leaves the foreground. It does not fire |
// when a foreground page is permanently closed; for that, listen to |
// OnComplete instead. |