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

Side by Side Diff: chrome/browser/page_load_metrics/page_load_metrics_observer.cc

Issue 2798953002: [PageLoadMetrics] Keep track of Ad Sizes on Pages (Closed)
Patch Set: Address comments from PS17 Created 3 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/page_load_metrics/page_load_metrics_observer.h" 5 #include "chrome/browser/page_load_metrics/page_load_metrics_observer.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 namespace page_load_metrics { 9 namespace page_load_metrics {
10 10
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 base::Optional<base::TimeDelta>() /* first_foreground_time */, 50 base::Optional<base::TimeDelta>() /* first_foreground_time */,
51 started_in_foreground /* started_in_foreground */, 51 started_in_foreground /* started_in_foreground */,
52 UserInitiatedInfo::BrowserInitiated(), url, url, true /* did_commit */, 52 UserInitiatedInfo::BrowserInitiated(), url, url, true /* did_commit */,
53 page_load_metrics::END_NONE, 53 page_load_metrics::END_NONE,
54 page_load_metrics::UserInitiatedInfo::NotUserInitiated(), 54 page_load_metrics::UserInitiatedInfo::NotUserInitiated(),
55 base::TimeDelta(), page_load_metrics::PageLoadMetadata(), 55 base::TimeDelta(), page_load_metrics::PageLoadMetadata(),
56 page_load_metrics::PageLoadMetadata()); 56 page_load_metrics::PageLoadMetadata());
57 } 57 }
58 58
59 ExtraRequestInfo::ExtraRequestInfo( 59 ExtraRequestInfo::ExtraRequestInfo(
60 const GURL& url,
61 int frame_tree_node_id,
60 bool was_cached, 62 bool was_cached,
61 int64_t raw_body_bytes, 63 int64_t raw_body_bytes,
62 int64_t original_network_content_length, 64 int64_t original_network_content_length,
63 std::unique_ptr<data_reduction_proxy::DataReductionProxyData> 65 std::unique_ptr<data_reduction_proxy::DataReductionProxyData>
64 data_reduction_proxy_data) 66 data_reduction_proxy_data)
65 : was_cached(was_cached), 67 : url(url),
68 frame_tree_node_id(frame_tree_node_id),
69 was_cached(was_cached),
66 raw_body_bytes(raw_body_bytes), 70 raw_body_bytes(raw_body_bytes),
67 original_network_content_length(original_network_content_length), 71 original_network_content_length(original_network_content_length),
68 data_reduction_proxy_data(std::move(data_reduction_proxy_data)) {} 72 data_reduction_proxy_data(std::move(data_reduction_proxy_data)) {}
69 73
70 ExtraRequestInfo::~ExtraRequestInfo() {} 74 ExtraRequestInfo::~ExtraRequestInfo() {}
71 75
72 FailedProvisionalLoadInfo::FailedProvisionalLoadInfo(base::TimeDelta interval, 76 FailedProvisionalLoadInfo::FailedProvisionalLoadInfo(base::TimeDelta interval,
73 net::Error error) 77 net::Error error)
74 : time_to_failed_provisional_load(interval), error(error) {} 78 : time_to_failed_provisional_load(interval), error(error) {}
75 79
76 FailedProvisionalLoadInfo::~FailedProvisionalLoadInfo() {} 80 FailedProvisionalLoadInfo::~FailedProvisionalLoadInfo() {}
77 81
78 PageLoadMetricsObserver::ObservePolicy PageLoadMetricsObserver::OnStart( 82 PageLoadMetricsObserver::ObservePolicy PageLoadMetricsObserver::OnStart(
79 content::NavigationHandle* navigation_handle, 83 content::NavigationHandle* navigation_handle,
80 const GURL& currently_committed_url, 84 const GURL& currently_committed_url,
81 bool started_in_foreground) { 85 bool started_in_foreground) {
82 return CONTINUE_OBSERVING; 86 return CONTINUE_OBSERVING;
83 } 87 }
84 88
85 PageLoadMetricsObserver::ObservePolicy PageLoadMetricsObserver::OnRedirect( 89 PageLoadMetricsObserver::ObservePolicy PageLoadMetricsObserver::OnRedirect(
86 content::NavigationHandle* navigation_handle) { 90 content::NavigationHandle* navigation_handle) {
87 return CONTINUE_OBSERVING; 91 return CONTINUE_OBSERVING;
88 } 92 }
89 93
90 PageLoadMetricsObserver::ObservePolicy PageLoadMetricsObserver::OnCommit( 94 PageLoadMetricsObserver::ObservePolicy PageLoadMetricsObserver::OnCommit(
91 content::NavigationHandle* navigation_handle) { 95 content::NavigationHandle* navigation_handle) {
92 return CONTINUE_OBSERVING; 96 return CONTINUE_OBSERVING;
93 } 97 }
94 98
99 PageLoadMetricsObserver::ObservePolicy
100 PageLoadMetricsObserver::OnDidFinishSubFrameNavigation(
101 content::NavigationHandle* navigation_handle) {
102 return CONTINUE_OBSERVING;
103 }
104
95 PageLoadMetricsObserver::ObservePolicy PageLoadMetricsObserver::OnHidden( 105 PageLoadMetricsObserver::ObservePolicy PageLoadMetricsObserver::OnHidden(
96 const PageLoadTiming& timing, 106 const PageLoadTiming& timing,
97 const PageLoadExtraInfo& extra_info) { 107 const PageLoadExtraInfo& extra_info) {
98 return CONTINUE_OBSERVING; 108 return CONTINUE_OBSERVING;
99 } 109 }
100 110
101 PageLoadMetricsObserver::ObservePolicy PageLoadMetricsObserver::OnShown() { 111 PageLoadMetricsObserver::ObservePolicy PageLoadMetricsObserver::OnShown() {
102 return CONTINUE_OBSERVING; 112 return CONTINUE_OBSERVING;
103 } 113 }
104 114
105 PageLoadMetricsObserver::ObservePolicy 115 PageLoadMetricsObserver::ObservePolicy
106 PageLoadMetricsObserver::FlushMetricsOnAppEnterBackground( 116 PageLoadMetricsObserver::FlushMetricsOnAppEnterBackground(
107 const PageLoadTiming& timing, 117 const PageLoadTiming& timing,
108 const PageLoadExtraInfo& extra_info) { 118 const PageLoadExtraInfo& extra_info) {
109 return CONTINUE_OBSERVING; 119 return CONTINUE_OBSERVING;
110 } 120 }
111 121
112 PageLoadMetricsObserver::ObservePolicy 122 PageLoadMetricsObserver::ObservePolicy
113 PageLoadMetricsObserver::ShouldObserveMimeType( 123 PageLoadMetricsObserver::ShouldObserveMimeType(
114 const std::string& mime_type) const { 124 const std::string& mime_type) const {
115 return mime_type == "text/html" || mime_type == "application/xhtml+xml" 125 return mime_type == "text/html" || mime_type == "application/xhtml+xml"
116 ? CONTINUE_OBSERVING 126 ? CONTINUE_OBSERVING
117 : STOP_OBSERVING; 127 : STOP_OBSERVING;
118 } 128 }
119 129
120 } // namespace page_load_metrics 130 } // namespace page_load_metrics
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698