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

Side by Side Diff: chrome/browser/page_load_metrics/observers/protocol_page_load_metrics_observer.cc

Issue 2541433003: [PageLoad Metrics] Add NavigationTo* FCP and FMP to H2/QUIC/H11 metrics (Closed)
Patch Set: Created 4 years 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
« no previous file with comments | « no previous file | chrome/browser/page_load_metrics/observers/protocol_page_load_metrics_observer_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/observers/protocol_page_load_metrics_ observer.h" 5 #include "chrome/browser/page_load_metrics/observers/protocol_page_load_metrics_ observer.h"
6 6
7 #include "chrome/browser/page_load_metrics/page_load_metrics_util.h" 7 #include "chrome/browser/page_load_metrics/page_load_metrics_util.h"
8 8
9 page_load_metrics::PageLoadMetricsObserver::ObservePolicy 9 page_load_metrics::PageLoadMetricsObserver::ObservePolicy
10 ProtocolPageLoadMetricsObserver::OnStart( 10 ProtocolPageLoadMetricsObserver::OnStart(
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 case net::HttpResponseInfo::CONNECTION_INFO_DEPRECATED_SPDY3: 73 case net::HttpResponseInfo::CONNECTION_INFO_DEPRECATED_SPDY3:
74 case net::HttpResponseInfo::CONNECTION_INFO_DEPRECATED_HTTP2_14: 74 case net::HttpResponseInfo::CONNECTION_INFO_DEPRECATED_HTTP2_14:
75 case net::HttpResponseInfo::CONNECTION_INFO_DEPRECATED_HTTP2_15: 75 case net::HttpResponseInfo::CONNECTION_INFO_DEPRECATED_HTTP2_15:
76 case net::HttpResponseInfo::CONNECTION_INFO_HTTP0_9: 76 case net::HttpResponseInfo::CONNECTION_INFO_HTTP0_9:
77 case net::HttpResponseInfo::CONNECTION_INFO_HTTP1_0: 77 case net::HttpResponseInfo::CONNECTION_INFO_HTTP1_0:
78 case net::HttpResponseInfo::NUM_OF_CONNECTION_INFOS: 78 case net::HttpResponseInfo::NUM_OF_CONNECTION_INFOS:
79 return; 79 return;
80 case net::HttpResponseInfo::CONNECTION_INFO_HTTP1_1: 80 case net::HttpResponseInfo::CONNECTION_INFO_HTTP1_1:
81 PAGE_LOAD_HISTOGRAM( 81 PAGE_LOAD_HISTOGRAM(
82 "PageLoad.Clients.Protocol.H11.PaintTiming." 82 "PageLoad.Clients.Protocol.H11.PaintTiming."
83 "NavigationToFirstContentfulPaint",
84 timing.first_contentful_paint.value());
85 PAGE_LOAD_HISTOGRAM(
86 "PageLoad.Clients.Protocol.H11.PaintTiming."
83 "ParseStartToFirstContentfulPaint", 87 "ParseStartToFirstContentfulPaint",
84 timing.first_contentful_paint.value() - timing.parse_start.value()); 88 timing.first_contentful_paint.value() - timing.parse_start.value());
85 break; 89 break;
86 case net::HttpResponseInfo::CONNECTION_INFO_HTTP2: 90 case net::HttpResponseInfo::CONNECTION_INFO_HTTP2:
87 PAGE_LOAD_HISTOGRAM( 91 PAGE_LOAD_HISTOGRAM(
88 "PageLoad.Clients.Protocol.H2.PaintTiming." 92 "PageLoad.Clients.Protocol.H2.PaintTiming."
93 "NavigationToFirstContentfulPaint",
94 timing.first_contentful_paint.value());
95 PAGE_LOAD_HISTOGRAM(
96 "PageLoad.Clients.Protocol.H2.PaintTiming."
89 "ParseStartToFirstContentfulPaint", 97 "ParseStartToFirstContentfulPaint",
90 timing.first_contentful_paint.value() - timing.parse_start.value()); 98 timing.first_contentful_paint.value() - timing.parse_start.value());
91 break; 99 break;
92 case net::HttpResponseInfo::CONNECTION_INFO_QUIC_UNKNOWN_VERSION: 100 case net::HttpResponseInfo::CONNECTION_INFO_QUIC_UNKNOWN_VERSION:
93 case net::HttpResponseInfo::CONNECTION_INFO_QUIC_32: 101 case net::HttpResponseInfo::CONNECTION_INFO_QUIC_32:
94 case net::HttpResponseInfo::CONNECTION_INFO_QUIC_33: 102 case net::HttpResponseInfo::CONNECTION_INFO_QUIC_33:
95 case net::HttpResponseInfo::CONNECTION_INFO_QUIC_34: 103 case net::HttpResponseInfo::CONNECTION_INFO_QUIC_34:
96 case net::HttpResponseInfo::CONNECTION_INFO_QUIC_35: 104 case net::HttpResponseInfo::CONNECTION_INFO_QUIC_35:
97 case net::HttpResponseInfo::CONNECTION_INFO_QUIC_36: 105 case net::HttpResponseInfo::CONNECTION_INFO_QUIC_36:
98 PAGE_LOAD_HISTOGRAM( 106 PAGE_LOAD_HISTOGRAM(
99 "PageLoad.Clients.Protocol.QUIC.PaintTiming." 107 "PageLoad.Clients.Protocol.QUIC.PaintTiming."
108 "NavigationToFirstContentfulPaint",
109 timing.first_contentful_paint.value());
110 PAGE_LOAD_HISTOGRAM(
111 "PageLoad.Clients.Protocol.QUIC.PaintTiming."
100 "ParseStartToFirstContentfulPaint", 112 "ParseStartToFirstContentfulPaint",
101 timing.first_contentful_paint.value() - timing.parse_start.value()); 113 timing.first_contentful_paint.value() - timing.parse_start.value());
102 break; 114 break;
103 } 115 }
104 } 116 }
105 117
106 void ProtocolPageLoadMetricsObserver::OnFirstMeaningfulPaint( 118 void ProtocolPageLoadMetricsObserver::OnFirstMeaningfulPaint(
107 const page_load_metrics::PageLoadTiming& timing, 119 const page_load_metrics::PageLoadTiming& timing,
108 const page_load_metrics::PageLoadExtraInfo& extra_info) { 120 const page_load_metrics::PageLoadExtraInfo& extra_info) {
109 switch (connection_info_) { 121 switch (connection_info_) {
110 case net::HttpResponseInfo::CONNECTION_INFO_UNKNOWN: 122 case net::HttpResponseInfo::CONNECTION_INFO_UNKNOWN:
111 case net::HttpResponseInfo::CONNECTION_INFO_DEPRECATED_SPDY2: 123 case net::HttpResponseInfo::CONNECTION_INFO_DEPRECATED_SPDY2:
112 case net::HttpResponseInfo::CONNECTION_INFO_DEPRECATED_SPDY3: 124 case net::HttpResponseInfo::CONNECTION_INFO_DEPRECATED_SPDY3:
113 case net::HttpResponseInfo::CONNECTION_INFO_DEPRECATED_HTTP2_14: 125 case net::HttpResponseInfo::CONNECTION_INFO_DEPRECATED_HTTP2_14:
114 case net::HttpResponseInfo::CONNECTION_INFO_DEPRECATED_HTTP2_15: 126 case net::HttpResponseInfo::CONNECTION_INFO_DEPRECATED_HTTP2_15:
115 case net::HttpResponseInfo::CONNECTION_INFO_HTTP0_9: 127 case net::HttpResponseInfo::CONNECTION_INFO_HTTP0_9:
116 case net::HttpResponseInfo::CONNECTION_INFO_HTTP1_0: 128 case net::HttpResponseInfo::CONNECTION_INFO_HTTP1_0:
117 case net::HttpResponseInfo::NUM_OF_CONNECTION_INFOS: 129 case net::HttpResponseInfo::NUM_OF_CONNECTION_INFOS:
118 return; 130 return;
119 case net::HttpResponseInfo::CONNECTION_INFO_HTTP1_1: 131 case net::HttpResponseInfo::CONNECTION_INFO_HTTP1_1:
120 PAGE_LOAD_HISTOGRAM( 132 PAGE_LOAD_HISTOGRAM(
121 "PageLoad.Clients.Protocol.H11.Experimental.PaintTiming." 133 "PageLoad.Clients.Protocol.H11.Experimental.PaintTiming."
134 "NavigationToFirstMeaningfulPaint",
135 timing.first_meaningful_paint.value());
136 PAGE_LOAD_HISTOGRAM(
137 "PageLoad.Clients.Protocol.H11.Experimental.PaintTiming."
122 "ParseStartToFirstMeaningfulPaint", 138 "ParseStartToFirstMeaningfulPaint",
123 timing.first_meaningful_paint.value() - timing.parse_start.value()); 139 timing.first_meaningful_paint.value() - timing.parse_start.value());
124 break; 140 break;
125 case net::HttpResponseInfo::CONNECTION_INFO_HTTP2: 141 case net::HttpResponseInfo::CONNECTION_INFO_HTTP2:
126 PAGE_LOAD_HISTOGRAM( 142 PAGE_LOAD_HISTOGRAM(
127 "PageLoad.Clients.Protocol.H2.Experimental.PaintTiming." 143 "PageLoad.Clients.Protocol.H2.Experimental.PaintTiming."
144 "NavigationToFirstMeaningfulPaint",
145 timing.first_meaningful_paint.value());
146 PAGE_LOAD_HISTOGRAM(
147 "PageLoad.Clients.Protocol.H2.Experimental.PaintTiming."
128 "ParseStartToFirstMeaningfulPaint", 148 "ParseStartToFirstMeaningfulPaint",
129 timing.first_meaningful_paint.value() - timing.parse_start.value()); 149 timing.first_meaningful_paint.value() - timing.parse_start.value());
130 break; 150 break;
131 case net::HttpResponseInfo::CONNECTION_INFO_QUIC_UNKNOWN_VERSION: 151 case net::HttpResponseInfo::CONNECTION_INFO_QUIC_UNKNOWN_VERSION:
132 case net::HttpResponseInfo::CONNECTION_INFO_QUIC_32: 152 case net::HttpResponseInfo::CONNECTION_INFO_QUIC_32:
133 case net::HttpResponseInfo::CONNECTION_INFO_QUIC_33: 153 case net::HttpResponseInfo::CONNECTION_INFO_QUIC_33:
134 case net::HttpResponseInfo::CONNECTION_INFO_QUIC_34: 154 case net::HttpResponseInfo::CONNECTION_INFO_QUIC_34:
135 case net::HttpResponseInfo::CONNECTION_INFO_QUIC_35: 155 case net::HttpResponseInfo::CONNECTION_INFO_QUIC_35:
136 case net::HttpResponseInfo::CONNECTION_INFO_QUIC_36: 156 case net::HttpResponseInfo::CONNECTION_INFO_QUIC_36:
137 PAGE_LOAD_HISTOGRAM( 157 PAGE_LOAD_HISTOGRAM(
138 "PageLoad.Clients.Protocol.QUIC.Experimental.PaintTiming." 158 "PageLoad.Clients.Protocol.QUIC.Experimental.PaintTiming."
159 "NavigationToFirstMeaningfulPaint",
160 timing.first_meaningful_paint.value());
161 PAGE_LOAD_HISTOGRAM(
162 "PageLoad.Clients.Protocol.QUIC.Experimental.PaintTiming."
139 "ParseStartToFirstMeaningfulPaint", 163 "ParseStartToFirstMeaningfulPaint",
140 timing.first_meaningful_paint.value() - timing.parse_start.value()); 164 timing.first_meaningful_paint.value() - timing.parse_start.value());
141 break; 165 break;
142 } 166 }
143 } 167 }
144 168
145 void ProtocolPageLoadMetricsObserver::OnDomContentLoadedEventStart( 169 void ProtocolPageLoadMetricsObserver::OnDomContentLoadedEventStart(
146 const page_load_metrics::PageLoadTiming& timing, 170 const page_load_metrics::PageLoadTiming& timing,
147 const page_load_metrics::PageLoadExtraInfo& extra_info) { 171 const page_load_metrics::PageLoadExtraInfo& extra_info) {
148 switch (connection_info_) { 172 switch (connection_info_) {
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 case net::HttpResponseInfo::CONNECTION_INFO_QUIC_34: 236 case net::HttpResponseInfo::CONNECTION_INFO_QUIC_34:
213 case net::HttpResponseInfo::CONNECTION_INFO_QUIC_35: 237 case net::HttpResponseInfo::CONNECTION_INFO_QUIC_35:
214 case net::HttpResponseInfo::CONNECTION_INFO_QUIC_36: 238 case net::HttpResponseInfo::CONNECTION_INFO_QUIC_36:
215 PAGE_LOAD_HISTOGRAM( 239 PAGE_LOAD_HISTOGRAM(
216 "PageLoad.Clients.Protocol.QUIC.DocumentTiming." 240 "PageLoad.Clients.Protocol.QUIC.DocumentTiming."
217 "NavigationToLoadEventFired", 241 "NavigationToLoadEventFired",
218 timing.load_event_start.value()); 242 timing.load_event_start.value());
219 break; 243 break;
220 } 244 }
221 } 245 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/page_load_metrics/observers/protocol_page_load_metrics_observer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698