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

Issue 8336012: Fix bug where Navigation Timing reports negative load time when redirecting to (Closed)

Created:
9 years, 2 months ago by James Simonsen
Modified:
9 years, 1 month ago
CC:
chromium-reviews, cbentzel+watch_chromium.org, darin-cc_chromium.org, Paweł Hajdan Jr.
Visibility:
Public.

Description

Fix bug where Navigation Timing reports negative load time when redirecting to a cached page. The problem is that the same ResourceLoadTiming struct is re-used for each redirect. So, we record the deltas for connect time, headers, send request, etc., for each redirect. But, after the last redirect, we simply have a cache hit. So, the base_time is updated for that cache hit, but the deltas are still relative to the old base_time value. When we apply the old deltas to the new base_time, we end up with a time in the future. To fix this, I clear ResourceLoadTimingInfo after each redirect. I've added a UI test for this. I could've done a unit test, but we have no end- to-end Navigation Timing tests and it'd be easy for this to be broken by some unrelated change to NetLog and redirects, so I prefer having this test be a safe guard. On a related note, I noticed that LoadTimingObserver::OnAddURLRequestEntry() is called at least twice for each source.id. Once for the normal URLRequest, and once for the AppCacheURLRequest. Fortunately, they're only 100 ns apart, so it doesn't screw up the times. But, it was a surprise to me. Perhaps we should ignore the AppCache requests? BUG=None TEST=ui_tests Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=107604

Patch Set 1 #

Patch Set 2 : Fix Win build #

Unified diffs Side-by-side diffs Delta from patch set Stats (+44 lines, -2 lines) Patch
M chrome/browser/net/load_timing_observer.cc View 2 chunks +3 lines, -2 lines 0 comments Download
A chrome/browser/net/load_timing_observer_uitest.cc View 1 1 chunk +40 lines, -0 lines 0 comments Download
M chrome/chrome_tests.gypi View 1 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 9 (0 generated)
James Simonsen
9 years, 2 months ago (2011-10-18 03:15:13 UTC) #1
James Simonsen
Ping. You guys are likely the most knowledgeable of this code. It'd be nice if ...
9 years, 2 months ago (2011-10-25 02:44:51 UTC) #2
tonyg
LGTM Sorry I missed the review earlier. Thanks especially for adding a test.
9 years, 2 months ago (2011-10-25 10:05:25 UTC) #3
James Simonsen
Eric or Randy, can you please give an OWNERS lgtm? This has already been reviewed ...
9 years, 1 month ago (2011-10-26 20:33:15 UTC) #4
Randy Smith (Not in Mondays)
Rubber-stamp LGTM.
9 years, 1 month ago (2011-10-26 21:54:28 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/simonjam@chromium.org/8336012/1
9 years, 1 month ago (2011-10-26 21:58:46 UTC) #6
commit-bot: I haz the power
Try job failure for 8336012-1 (retry) on win_rel for step "compile" (clobber build). It's a ...
9 years, 1 month ago (2011-10-26 23:04:49 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/simonjam@chromium.org/8336012/8001
9 years, 1 month ago (2011-10-27 17:24:55 UTC) #8
commit-bot: I haz the power
9 years, 1 month ago (2011-10-27 18:32:48 UTC) #9
Change committed as 107604

Powered by Google App Engine
This is Rietveld 408576698