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

Unified Diff: chrome/renderer/page_load_histograms.cc

Issue 9301043: Handle NULL load_event_start. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: adding load_event_end Created 8 years, 11 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/page_load_histograms.cc
diff --git a/chrome/renderer/page_load_histograms.cc b/chrome/renderer/page_load_histograms.cc
index a1cf288f092e1120ecf051653ed3581e264811e9..e569becbfa2b51a2021951dde434c403a9945e55 100644
--- a/chrome/renderer/page_load_histograms.cc
+++ b/chrome/renderer/page_load_histograms.cc
@@ -61,8 +61,11 @@ static void DumpPerformanceTiming(const WebPerformance& performance,
DCHECK(!navigation_start.is_null());
DCHECK(!request_start.is_null());
DCHECK(!response_start.is_null());
- DCHECK(!load_event_start.is_null());
- DCHECK(!load_event_end.is_null());
+ // TODO(dominich): Investigate conditions under which |load_event_start| and
+ // |load_event_end| may be NULL as in the non-PT_ case below. Examples in
+ // http://crbug.com/112006.
+ // DCHECK(!load_event_start.is_null());
+ // DCHECK(!load_event_end.is_null());
if (document_state->web_timing_histograms_recorded())
return;
@@ -71,16 +74,24 @@ static void DumpPerformanceTiming(const WebPerformance& performance,
// TODO(simonjam): There is no way to distinguish between abandonment and
// intentional Javascript navigation before the load event fires.
// TODO(dominich): Load type breakdown
+ if (!load_event_start.is_null()) {
+ PLT_HISTOGRAM("PLT.PT_BeginToFinishDoc", load_event_start - begin);
+ PLT_HISTOGRAM("PLT.PT_CommitToFinishDoc",
+ load_event_start - response_start);
+ }
+ if (!load_event_end.is_null()) {
+ PLT_HISTOGRAM("PLT.PT_BeginToFinish", load_event_end - begin);
+ PLT_HISTOGRAM("PLT.PT_CommitToFinish", load_event_end - response_start);
+ PLT_HISTOGRAM("PLT.PT_RequestToFinish", load_event_end - navigation_start);
+ PLT_HISTOGRAM("PLT.PT_StartToFinish", load_event_end - request_start);
+ }
+ if (!load_event_start.is_null() && !load_event_end.is_null()) {
+ PLT_HISTOGRAM("PLT.PT_FinishDocToFinish",
+ load_event_end - load_event_start);
+ }
PLT_HISTOGRAM("PLT.PT_BeginToCommit", response_start - begin);
- PLT_HISTOGRAM("PLT.PT_BeginToFinish", load_event_end - begin);
- PLT_HISTOGRAM("PLT.PT_BeginToFinishDoc", load_event_start - begin);
- PLT_HISTOGRAM("PLT.PT_CommitToFinish", load_event_end - response_start);
- PLT_HISTOGRAM("PLT.PT_CommitToFinishDoc", load_event_start - response_start);
- PLT_HISTOGRAM("PLT.PT_FinishDocToFinish", load_event_end - load_event_start);
- PLT_HISTOGRAM("PLT.PT_RequestToFinish", load_event_end - navigation_start);
PLT_HISTOGRAM("PLT.PT_RequestToStart", request_start - navigation_start);
PLT_HISTOGRAM("PLT.PT_StartToCommit", response_start - request_start);
- PLT_HISTOGRAM("PLT.PT_StartToFinish", load_event_end - request_start);
}
enum MissingStartType {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698