summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/page_load_histograms.cc
diff options
context:
space:
mode:
authortonyg@chromium.org <tonyg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-14 16:38:55 +0000
committertonyg@chromium.org <tonyg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-14 16:38:55 +0000
commitdf9a6e01402dc07755bc0da0f9863e4f2ee578e7 (patch)
treec332c724fb4199713912a8b4f5d5f02c6999fe88 /chrome/renderer/page_load_histograms.cc
parent53c7ce4f0ad213cfe239e35851aff3a460e0e1c0 (diff)
downloadchromium_src-df9a6e01402dc07755bc0da0f9863e4f2ee578e7.zip
chromium_src-df9a6e01402dc07755bc0da0f9863e4f2ee578e7.tar.gz
chromium_src-df9a6e01402dc07755bc0da0f9863e4f2ee578e7.tar.bz2
Don't add to LoadStart and LoadEnd histograms if load event hasn't fired yet.
BUG=64321 TEST=adhoc (visit http://www/~eisinger/redirect.html) Review URL: http://codereview.chromium.org/5382006 Patch from James Simonsen <simonjam@chromium.org>. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@69141 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/page_load_histograms.cc')
-rw-r--r--chrome/renderer/page_load_histograms.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/chrome/renderer/page_load_histograms.cc b/chrome/renderer/page_load_histograms.cc
index 711c2f2..e4831f7 100644
--- a/chrome/renderer/page_load_histograms.cc
+++ b/chrome/renderer/page_load_histograms.cc
@@ -106,10 +106,13 @@ 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);
+ // TODO(simonjam): There is no way to distinguish between abandonment and
+ // intentional Javascript navigation before the load event fires.
+ if (!load_event_start.is_null())
+ PLT_HISTOGRAM("PLT.NavStartToLoadStart",
+ load_event_start - navigation_start);
+ if (!load_event_end.is_null())
+ PLT_HISTOGRAM("PLT.NavStartToLoadEnd", load_event_end - navigation_start);
// We properly handle null values for the next 3 variables.
Time request = navigation_state->request_time();