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

Unified Diff: content/browser/frame_host/navigator_impl.cc

Issue 577963002: Add time-to-network histogram considering browser side navigation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: histogram.xml Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..7332dc49ffb32b812413c0c6f6a85368591cc377 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"
@@ -341,7 +342,6 @@ 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();
-
clamy 2014/09/19 14:56:03 Did you remove the line on purpose? I think it is
carlosk 2014/09/23 17:02:56 Done. It was not on purpose: I did changes in this
FrameMsg_Navigate_Params navigate_params;
RenderFrameHostManager* manager =
render_frame_host->frame_tree_node()->render_manager();
@@ -351,6 +351,8 @@ bool NavigatorImpl::NavigateToEntry(
// node.
if (CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableBrowserSideNavigation)) {
+ navigation_start_time_ = navigation_start;
+ navigation_start_url_ = entry.GetURL();
// Create the navigation parameters.
MakeNavigateParams(
entry, *controller_, reload_type, navigation_start, &navigate_params);
@@ -388,6 +390,8 @@ bool NavigatorImpl::NavigateToEntry(
navigate_params.transferred_request_child_id ==
dest_render_frame_host->GetProcess()->GetID();
if (!is_transfer_to_same) {
+ navigation_start_time_ = navigation_start;
+ navigation_start_url_ = entry.GetURL();
dest_render_frame_host->Navigate(navigate_params);
} else {
// No need to navigate again. Just resume the deferred request.
@@ -666,6 +670,14 @@ void NavigatorImpl::CommitNavigation(
// renderer.
}
+void NavigatorImpl::LogResourceRequestTime(
+ base::TimeTicks timestamp, GURL url) {
+ if (navigation_start_url_ == url) {
davidben 2014/09/19 21:52:45 This is slightly racy, but there's not really much
carlosk 2014/09/23 17:02:57 Yes! I was from the start looking for a "request_i
+ base::TimeDelta time_to_network = timestamp - navigation_start_time_;
+ LOCAL_HISTOGRAM_TIMES("PlzNavigate.TimeToNetworkRequest", time_to_network);
clamy 2014/09/19 14:56:03 You want a UMA_HISTOGRAM_TIMES, otherwise we will
carlosk 2014/09/23 17:02:56 Done! My bad!
+ }
+}
+
void NavigatorImpl::CheckWebUIRendererDoesNotDisplayNormalURL(
RenderFrameHostImpl* render_frame_host,
const GURL& url) {

Powered by Google App Engine
This is Rietveld 408576698