Chromium Code Reviews| Index: content/browser/frame_host/navigator_impl.cc |
| diff --git a/content/browser/frame_host/navigator_impl.cc b/content/browser/frame_host/navigator_impl.cc |
| index 5e6ba3c898ad4715baacd672aaa0bc29eb00de49..dc8c9691d0886cb01ec3f0f92095ede4c46f0264 100644 |
| --- a/content/browser/frame_host/navigator_impl.cc |
| +++ b/content/browser/frame_host/navigator_impl.cc |
| @@ -281,8 +281,9 @@ bool NavigatorImpl::NavigateToEntry( |
| // "Open link in new tab"). We need to keep it above RFHM::Navigate() call to |
| // capture the time needed for the RenderFrameHost initialization. |
| base::TimeTicks navigation_start = base::TimeTicks::Now(); |
| - |
| - RenderFrameHostManager* manager = frame_tree_node->render_manager(); |
| + TRACE_EVENT_INSTANT_WITH_TIMESTAMP0( |
| + "navigation", "NavigationTiming navigationStart", |
| + TRACE_EVENT_SCOPE_GLOBAL, navigation_start.ToInternalValue()); |
| // PlzNavigate: the RenderFrameHosts are no longer asked to navigate. |
| if (IsBrowserSideNavigationEnabled()) { |
| @@ -291,6 +292,21 @@ bool NavigatorImpl::NavigateToEntry( |
| RequestNavigation(frame_tree_node, dest_url, dest_referrer, frame_entry, |
| entry, reload_type, is_same_document_history_load, |
| navigation_start); |
| + if (frame_tree_node->IsMainFrame()) { |
|
clamy
2015/12/22 10:55:24
nit: add a TODO to extend these to subframes as we
carlosk
2015/12/22 13:58:18
Done. In other places as well.
|
| + // For these traces below we're using the navigation handle as the async |
| + // trace id, |navigation_start| as the timestamp and reporting the |
| + // FrameTreeNode id as a parameter. |
| + TRACE_EVENT_ASYNC_BEGIN_WITH_TIMESTAMP1( |
| + "navigation", "Navigation timeToNetworkStack", |
| + frame_tree_node->navigation_request()->navigation_handle(), |
| + navigation_start.ToInternalValue(), |
| + "FrameTreeNode id", frame_tree_node->frame_tree_node_id()); |
| + TRACE_EVENT_ASYNC_BEGIN_WITH_TIMESTAMP1( |
| + "navigation", "Navigation timeToCommit", |
| + frame_tree_node->navigation_request()->navigation_handle(), |
| + navigation_start.ToInternalValue(), |
| + "FrameTreeNode id", frame_tree_node->frame_tree_node_id()); |
| + } |
| // Notify observers about navigation if this is for the pending entry. |
| if (delegate_ && is_pending_entry) |
| @@ -300,7 +316,7 @@ bool NavigatorImpl::NavigateToEntry( |
| } |
| RenderFrameHostImpl* dest_render_frame_host = |
| - manager->Navigate(dest_url, frame_entry, entry); |
| + frame_tree_node->render_manager()->Navigate(dest_url, frame_entry, entry); |
| if (!dest_render_frame_host) |
| return false; // Unable to create the desired RenderFrameHost. |
| @@ -491,6 +507,12 @@ void NavigatorImpl::DidNavigate( |
| // Keep track of each frame's URL in its FrameTreeNode. |
| render_frame_host->frame_tree_node()->SetCurrentURL(params.url); |
| + if (did_navigate && render_frame_host->frame_tree_node()->IsMainFrame() && |
| + IsBrowserSideNavigationEnabled()) { |
| + TRACE_EVENT_ASYNC_END0("navigation", "Navigation timeToCommit", |
| + render_frame_host->navigation_handle()); |
| + } |
| + |
| // Send notification about committed provisional loads. This notification is |
| // different from the NAV_ENTRY_COMMITTED notification which doesn't include |
| // the actual URL navigated to and isn't sent for AUTO_SUBFRAME navigations. |