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

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

Issue 2039363003: FirstMeaningfulPaint UMA (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments Created 4 years, 4 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/metrics_web_contents_observer.h" 5 #include "chrome/browser/page_load_metrics/metrics_web_contents_observer.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <ostream> 8 #include <ostream>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 return false; 169 return false;
170 } 170 }
171 171
172 if (!EventsInOrder(timing.first_paint, timing.first_contentful_paint)) { 172 if (!EventsInOrder(timing.first_paint, timing.first_contentful_paint)) {
173 NOTREACHED() << "Invalid first_paint " << timing.first_paint 173 NOTREACHED() << "Invalid first_paint " << timing.first_paint
174 << " for first_contentful_paint " 174 << " for first_contentful_paint "
175 << timing.first_contentful_paint; 175 << timing.first_contentful_paint;
176 return false; 176 return false;
177 } 177 }
178 178
179 if (!EventsInOrder(timing.first_paint, timing.first_meaningful_paint)) {
180 NOTREACHED() << "Invalid first_paint " << timing.first_paint
181 << " for first_meaningful_paint "
182 << timing.first_meaningful_paint;
183 return false;
184 }
185
179 return true; 186 return true;
180 } 187 }
181 188
182 void RecordInternalError(InternalErrorLoadEvent event) { 189 void RecordInternalError(InternalErrorLoadEvent event) {
183 UMA_HISTOGRAM_ENUMERATION(internal::kErrorEvents, event, ERR_LAST_ENTRY); 190 UMA_HISTOGRAM_ENUMERATION(internal::kErrorEvents, event, ERR_LAST_ENTRY);
184 } 191 }
185 192
186 void RecordAppBackgroundPageLoadCompleted(bool completed_after_background) { 193 void RecordAppBackgroundPageLoadCompleted(bool completed_after_background) {
187 UMA_HISTOGRAM_BOOLEAN(internal::kPageLoadCompletedAfterAppBackground, 194 UMA_HISTOGRAM_BOOLEAN(internal::kPageLoadCompletedAfterAppBackground,
188 completed_after_background); 195 completed_after_background);
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 if (new_timing.first_layout && !last_timing.first_layout) 235 if (new_timing.first_layout && !last_timing.first_layout)
229 observer->OnFirstLayout(new_timing, extra_info); 236 observer->OnFirstLayout(new_timing, extra_info);
230 if (new_timing.first_paint && !last_timing.first_paint) 237 if (new_timing.first_paint && !last_timing.first_paint)
231 observer->OnFirstPaint(new_timing, extra_info); 238 observer->OnFirstPaint(new_timing, extra_info);
232 if (new_timing.first_text_paint && !last_timing.first_text_paint) 239 if (new_timing.first_text_paint && !last_timing.first_text_paint)
233 observer->OnFirstTextPaint(new_timing, extra_info); 240 observer->OnFirstTextPaint(new_timing, extra_info);
234 if (new_timing.first_image_paint && !last_timing.first_image_paint) 241 if (new_timing.first_image_paint && !last_timing.first_image_paint)
235 observer->OnFirstImagePaint(new_timing, extra_info); 242 observer->OnFirstImagePaint(new_timing, extra_info);
236 if (new_timing.first_contentful_paint && !last_timing.first_contentful_paint) 243 if (new_timing.first_contentful_paint && !last_timing.first_contentful_paint)
237 observer->OnFirstContentfulPaint(new_timing, extra_info); 244 observer->OnFirstContentfulPaint(new_timing, extra_info);
245 if (new_timing.first_meaningful_paint && !last_timing.first_meaningful_paint)
246 observer->OnFirstMeaningfulPaint(new_timing, extra_info);
238 if (new_timing.parse_start && !last_timing.parse_start) 247 if (new_timing.parse_start && !last_timing.parse_start)
239 observer->OnParseStart(new_timing, extra_info); 248 observer->OnParseStart(new_timing, extra_info);
240 if (new_timing.parse_stop && !last_timing.parse_stop) 249 if (new_timing.parse_stop && !last_timing.parse_stop)
241 observer->OnParseStop(new_timing, extra_info); 250 observer->OnParseStop(new_timing, extra_info);
242 if (extra_info.metadata.behavior_flags != last_metadata.behavior_flags) 251 if (extra_info.metadata.behavior_flags != last_metadata.behavior_flags)
243 observer->OnLoadingBehaviorObserved(extra_info); 252 observer->OnLoadingBehaviorObserved(extra_info);
244 } 253 }
245 254
246 } // namespace 255 } // namespace
247 256
(...skipping 748 matching lines...) Expand 10 before | Expand all | Expand 10 after
996 if (navigation_handle->IsSamePage() || navigation_handle->IsErrorPage()) 1005 if (navigation_handle->IsSamePage() || navigation_handle->IsErrorPage())
997 return false; 1006 return false;
998 const std::string& mime_type = web_contents()->GetContentsMimeType(); 1007 const std::string& mime_type = web_contents()->GetContentsMimeType();
999 if (mime_type != "text/html" && mime_type != "application/xhtml+xml") 1008 if (mime_type != "text/html" && mime_type != "application/xhtml+xml")
1000 return false; 1009 return false;
1001 } 1010 }
1002 return true; 1011 return true;
1003 } 1012 }
1004 1013
1005 } // namespace page_load_metrics 1014 } // namespace page_load_metrics
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698