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

Unified Diff: chrome/renderer/render_view.cc

Issue 330030: Log the PLT to the log file. This is a convenience for... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 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
« no previous file with comments | « chrome/renderer/render_view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/render_view.cc
===================================================================
--- chrome/renderer/render_view.cc (revision 30221)
+++ chrome/renderer/render_view.cc (working copy)
@@ -3420,6 +3420,8 @@
if (navigation_state->load_histograms_recorded() || finish.is_null())
return;
+ LogNavigationState(navigation_state, main_frame->dataSource());
+
Time request = navigation_state->request_time();
Time start = navigation_state->start_load_time();
Time commit = navigation_state->commit_load_time();
@@ -3568,6 +3570,25 @@
navigation_state->set_load_histograms_recorded(true);
}
+void RenderView::LogNavigationState(const NavigationState* state,
+ const WebDataSource* ds) const {
+ // Because this function gets called on every page load,
+ // take extra care to optimize it away if logging is turned off.
+ if (logging::LOG_INFO < logging::GetMinLogLevel())
+ return;
+
+ DCHECK(state);
+ DCHECK(ds);
+ GURL url(ds->request().url());
+ Time start = state->start_load_time();
+ Time finish = state->finish_load_time();
+ // TODO(mbelshe): should we log more stats?
+ LOG(INFO) << "PLT: "
+ << (finish - start).InMilliseconds()
+ << "ms "
+ << url.spec();
+}
+
void RenderView::focusAccessibilityObject(
const WebAccessibilityObject& acc_obj) {
#if defined(OS_WIN)
« no previous file with comments | « chrome/renderer/render_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698