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

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: Address comments from PS17 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..e6794603ea325e3a4d499dc4235acff9a8a07832 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,14 +200,21 @@ 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>
data_reduction_proxy_data);
-
~ExtraRequestInfo();
+ // The URL for the request.
+ const GURL url;
+
+ // The frame tree node id that initiated the request.
+ const int frame_tree_node_id;
+
// True if the resource was loaded from cache.
const bool was_cached;
@@ -218,7 +226,7 @@ struct ExtraRequestInfo {
const 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>
Bryan McQuade 2017/04/25 16:36:44 why the change to make this non-const?
jkarlin 2017/04/25 16:42:51 oversight, thanks!
data_reduction_proxy_data;
};
@@ -263,6 +271,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 |navigation_handle| to determine which happened. Note
+ // that |navigation_handle| 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 +394,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