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

Unified Diff: chrome/browser/page_load_metrics/metrics_web_contents_observer.cc

Issue 2798953002: [PageLoadMetrics] Keep track of Ad Sizes on Pages (Closed)
Patch Set: Updates and address Ojan's comments 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/metrics_web_contents_observer.cc
diff --git a/chrome/browser/page_load_metrics/metrics_web_contents_observer.cc b/chrome/browser/page_load_metrics/metrics_web_contents_observer.cc
index e3f51bf4946a1b2cc9437a0e973f4b77a78e5325..0eba8a00842ed55724958add9b194109776b61ea 100644
--- a/chrome/browser/page_load_metrics/metrics_web_contents_observer.cc
+++ b/chrome/browser/page_load_metrics/metrics_web_contents_observer.cc
@@ -245,6 +245,8 @@ PageLoadTracker* MetricsWebContentsObserver::GetTrackerOrNullForRequest(
}
void MetricsWebContentsObserver::OnRequestComplete(
+ const GURL& url,
+ int frame_tree_node_id,
const content::GlobalRequestID& request_id,
content::ResourceType resource_type,
bool was_cached,
@@ -256,8 +258,8 @@ void MetricsWebContentsObserver::OnRequestComplete(
GetTrackerOrNullForRequest(request_id, resource_type, creation_time);
if (tracker) {
ExtraRequestInfo extra_request_info(
- was_cached, raw_body_bytes, used_data_reduction_proxy,
- was_cached ? 0 : original_content_length);
+ url, frame_tree_node_id, was_cached, raw_body_bytes,
+ used_data_reduction_proxy, was_cached ? 0 : original_content_length);
tracker->OnLoadedResource(extra_request_info);
}
}
@@ -270,8 +272,11 @@ MetricsWebContentsObserver::GetPageLoadExtraInfoForCommittedLoad() {
void MetricsWebContentsObserver::DidFinishNavigation(
content::NavigationHandle* navigation_handle) {
- if (!navigation_handle->IsInMainFrame())
+ if (!navigation_handle->IsInMainFrame()) {
+ if (committed_load_)
+ committed_load_->CommitSubFrame(navigation_handle);
Charlie Harrison 2017/04/10 18:39:41 DidCommitSubFrame? CommitSubFrame sounds like a di
jkarlin 2017/04/11 16:46:27 Done.
return;
+ }
std::unique_ptr<PageLoadTracker> finished_nav(
std::move(provisional_loads_[navigation_handle]));

Powered by Google App Engine
This is Rietveld 408576698