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

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

Issue 2798953002: [PageLoadMetrics] Keep track of Ad Sizes on Pages (Closed)
Patch Set: Remove dcheck 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 side-by-side diff with in-line comments
Download patch
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.

Powered by Google App Engine
This is Rietveld 408576698