diff options
author | simonjam@chromium.org <simonjam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-07 21:58:12 +0000 |
---|---|---|
committer | simonjam@chromium.org <simonjam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-07 21:58:12 +0000 |
commit | 7a17bac000eb7083dcc059f8dc4f2ee38058a759 (patch) | |
tree | 18831604b906d6e2930a7e45a599ac2f5d61615e /content/browser/tab_contents/render_view_host_manager.cc | |
parent | 6d87809225ca3afa670aaab2abed769dec453cfb (diff) | |
download | chromium_src-7a17bac000eb7083dcc059f8dc4f2ee38058a759.zip chromium_src-7a17bac000eb7083dcc059f8dc4f2ee38058a759.tar.gz chromium_src-7a17bac000eb7083dcc059f8dc4f2ee38058a759.tar.bz2 |
Fix performance.timing.navigationStart on cross-renderer navigation.
According to the Navigation Timing spec, this value should be right after
beforeunload fires on the previous document. On cross-renderer navigations,
we were instead using the no-previous-document code path. The result is that
navigationStart is 80 - 500 ms earlier and lines up better with other load
time metrics.
I have a test case in mind that should be pretty reliable, but it will no
longer work once we update to make navigationStart 0 and base all other times
from that. Given that, I'm not sure it's worth writing the test, only to have
it removed in the next test. My idea was to have one tab initiate the navigation
in another tab, then record the time. navigationStart should be < the recorded
time. If you have any other ideas how to test this, please let me know.
See also: https://bugs.webkit.org/show_bug.cgi?id=75922
BUG=104788
TEST=Added printfs.
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=125035
Review URL: http://codereview.chromium.org/9166003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@125467 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/tab_contents/render_view_host_manager.cc')
-rw-r--r-- | content/browser/tab_contents/render_view_host_manager.cc | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/content/browser/tab_contents/render_view_host_manager.cc b/content/browser/tab_contents/render_view_host_manager.cc index 8b76009..687f2bf 100644 --- a/content/browser/tab_contents/render_view_host_manager.cc +++ b/content/browser/tab_contents/render_view_host_manager.cc @@ -272,8 +272,10 @@ void RenderViewHostManager::RendererProcessClosing( } } -void RenderViewHostManager::ShouldClosePage(bool for_cross_site_transition, - bool proceed) { +void RenderViewHostManager::ShouldClosePage( + bool for_cross_site_transition, + bool proceed, + const base::TimeTicks& proceed_time) { if (for_cross_site_transition) { // Ignore if we're not in a cross-site navigation. if (!cross_navigation_pending_) @@ -286,8 +288,12 @@ void RenderViewHostManager::ShouldClosePage(bool for_cross_site_transition, // already made by ShouldCloseTabOnUnresponsiveRenderer. In that case, it // is ok to do nothing here. if (pending_render_view_host_ && - pending_render_view_host_->are_navigations_suspended()) + pending_render_view_host_->are_navigations_suspended()) { pending_render_view_host_->SetNavigationsSuspended(false); + if (!proceed_time.is_null()) { + pending_render_view_host_->SetNavigationStartTime(proceed_time); + } + } } else { // Current page says to cancel. CancelPending(); |