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 ea9f921fc4de728d55746b0e285e3ddcd0d517ff..99759e02e7c43949dd68ff0265f51eb5e01d9892 100644 |
| --- a/content/browser/frame_host/navigator_impl.cc |
| +++ b/content/browser/frame_host/navigator_impl.cc |
| @@ -5,6 +5,7 @@ |
| #include "content/browser/frame_host/navigator_impl.h" |
| #include "base/command_line.h" |
| +#include "base/metrics/histogram.h" |
| #include "base/time/time.h" |
| #include "content/browser/frame_host/frame_tree.h" |
| #include "content/browser/frame_host/frame_tree_node.h" |
| @@ -336,11 +337,16 @@ bool NavigatorImpl::NavigateToEntry( |
| return false; |
| } |
| - // This will be used to set the Navigation Timing API navigationStart |
| + // This time will be used to set the Navigation Timing API navigationStart |
| // parameter for browser navigations in new tabs (intents, tabs opened through |
| // "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(); |
| + navigation_start_time_ = base::TimeTicks::Now(); |
| + LOG(WARNING) << "###########################"; |
| + LOG(WARNING) << "NAVIGATION STARTED AT " << navigation_start_time_.ToInternalValue(); |
| + LOG(WARNING) << "process_id / child_id = " << render_frame_host->GetProcess()->GetID(); |
| + LOG(WARNING) << "routing_id / render_frame_host = " << render_frame_host->routing_id(); |
|
clamy
2014/09/17 21:12:39
You cannot use the id values for this render_frame
carlosk
2014/09/18 15:00:52
Acknowledged.
|
| + LOG(WARNING) << "URL = " << entry.GetURL(); |
| FrameMsg_Navigate_Params navigate_params; |
| RenderFrameHostManager* manager = |
| @@ -353,7 +359,7 @@ bool NavigatorImpl::NavigateToEntry( |
| switches::kEnableBrowserSideNavigation)) { |
| // Create the navigation parameters. |
| MakeNavigateParams( |
| - entry, *controller_, reload_type, navigation_start, &navigate_params); |
| + entry, *controller_, reload_type, navigation_start_time_, &navigate_params); |
| return manager->RequestNavigation(entry, navigate_params); |
| } |
| @@ -377,7 +383,7 @@ bool NavigatorImpl::NavigateToEntry( |
| // TODO(vitalybuka): Move this before AboutToNavigateRenderFrame once |
| // http://crbug.com/408684 is fixed. |
| MakeNavigateParams( |
| - entry, *controller_, reload_type, navigation_start, &navigate_params); |
| + entry, *controller_, reload_type, navigation_start_time_, &navigate_params); |
| // Navigate in the desired RenderFrameHost. |
| // We can skip this step in the rare case that this is a transfer navigation |
| @@ -666,6 +672,13 @@ void NavigatorImpl::CommitNavigation( |
| // renderer. |
| } |
| +void NavigatorImpl::LogResourceRequestTime(base::TimeTicks timestamp) { |
| + base::TimeDelta time_to_network = base::TimeTicks::Now() - timestamp; |
|
clamy
2014/09/17 21:12:40
This should be timestamp - navigation_start_time_.
carlosk
2014/09/18 15:00:52
Yes, of course! Done!
|
| + LOG(WARNING) << "======================="; |
| + LOG(WARNING) << "Time to network request: " << time_to_network.InMilliseconds(); |
| + LOCAL_HISTOGRAM_TIMES("PlzNavigate.TimeToNetworkRequest", time_to_network); |
| +} |
| + |
| void NavigatorImpl::CheckWebUIRendererDoesNotDisplayNormalURL( |
| RenderFrameHostImpl* render_frame_host, |
| const GURL& url) { |