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..9746af5f945d16040bade2618a9688f97ea6fedc 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,7 +198,9 @@ 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); |
@@ -206,6 +209,12 @@ struct ExtraRequestInfo { |
~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; |
@@ -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( |
Bryan McQuade
2017/04/13 19:21:27
i dont see a strong reason that observers might wa
Bryan McQuade
2017/04/14 19:19:23
looks like this comment might've gotten lost (or i
jkarlin
2017/04/24 17:27:58
Sorry, I did miss it. Thanks for pointing it out a
|
+ 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. |