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

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: Clean up test 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 5c5b29fb2a2e5f45021bf611d10d3e51486aff56..8a40490d3e8ce64a83d4dc0e437260da5b032857 100644
--- a/chrome/browser/page_load_metrics/page_load_metrics_observer.h
+++ b/chrome/browser/page_load_metrics/page_load_metrics_observer.h
@@ -14,6 +14,7 @@
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_data.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"
@@ -199,7 +200,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,
int64_t original_network_content_length,
std::unique_ptr<data_reduction_proxy::DataReductionProxyData>
@@ -207,18 +210,24 @@ 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;
Charlie Harrison 2017/04/24 19:18:26 Why do all these members need to be non-const now?
jkarlin 2017/04/25 15:56:51 Remnant from when earlier when I could copy the cl
+ bool was_cached;
// The number of body (not header) prefilter bytes.
- const int64_t raw_body_bytes;
+ int64_t raw_body_bytes;
// 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;
// Data related to data saver.
- const std::unique_ptr<data_reduction_proxy::DataReductionProxyData>
+ std::unique_ptr<data_reduction_proxy::DataReductionProxyData>
data_reduction_proxy_data;
};
@@ -263,6 +272,15 @@ class PageLoadMetricsObserver {
// callbacks, and will be deleted after invocation of this method returns.
virtual ObservePolicy OnCommit(content::NavigationHandle* navigation_handle);
+ // OnDidFinishSubFrameNavigation is triggered when a sub-frame of the
+ // committed page has finished navigating. It has either committed, aborted,
+ // was a same document navigation, or has been replaced. It is up to the
+ // observer to query the navigation_handle to determine which happened. The
Charlie Harrison 2017/04/24 19:18:26 Be consistent when referencing navigation_handle i
jkarlin 2017/04/25 15:56:51 Replaced with |navigation_handle|
+ // navigation handle holds relevant data for the navigation, but will be
+ // destroyed soon after this call. Don't hold a reference to it.
+ virtual ObservePolicy OnDidFinishSubFrameNavigation(
+ 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.
@@ -377,7 +395,9 @@ class PageLoadMetricsObserver {
const FailedProvisionalLoadInfo& failed_provisional_load_info,
const PageLoadExtraInfo& extra_info) {}
- // Called whenever a request is loaded for this page load.
+ // Called whenever a request is loaded for this page load. This comes
+ // unfiltered from the ResourceDispatcherHost and may include blob requests
+ // and data uris.
virtual void OnLoadedResource(const ExtraRequestInfo& extra_request_info) {}
};

Powered by Google App Engine
This is Rietveld 408576698