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

Unified Diff: chrome/renderer/page_load_histograms.cc

Issue 5382006: Don't add to LoadStart and LoadEnd histograms if load event hasn't fired yet. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 10 years, 1 month 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 0fccbd1ae41c1bf115638c76f1fe4a2e365aeed9..a860783ecfeb378fce4a3522ec339edb958cf136 100644
--- a/chrome/renderer/page_load_histograms.cc
+++ b/chrome/renderer/page_load_histograms.cc
@@ -106,10 +106,12 @@ void PageLoadHistograms::Dump(WebFrame* frame) {
// Record the new PLT times prior to the faulty abandon check below.
// TODO(tonyg): There are many new details we can record, add them after the
// basic metrics are evaluated.
- TimeDelta nav_start_to_load_start = load_event_start - navigation_start;
- TimeDelta nav_start_to_load_end = load_event_end - navigation_start;
- PLT_HISTOGRAM("PLT.NavStartToLoadStart", nav_start_to_load_start);
- PLT_HISTOGRAM("PLT.NavStartToLoadEnd", nav_start_to_load_end);
+ if (!load_event_start.is_null() && !load_event_end.is_null()) {
+ TimeDelta nav_start_to_load_start = load_event_start - navigation_start;
+ TimeDelta nav_start_to_load_end = load_event_end - navigation_start;
+ PLT_HISTOGRAM("PLT.NavStartToLoadStart", nav_start_to_load_start);
+ PLT_HISTOGRAM("PLT.NavStartToLoadEnd", nav_start_to_load_end);
+ }
jar (doing other things) 2010/11/29 23:05:40 I think I'd like TonyG to review this, as care nee
tonyg 2010/12/04 01:34:39 I agree this is the right way to report client sid
// We properly handle null values for the next 3 variables.
Time request = navigation_state->request_time();
« 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