summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/page_load_histograms.h
diff options
context:
space:
mode:
authortonyg@chromium.org <tonyg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-05 18:14:36 +0000
committertonyg@chromium.org <tonyg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-05 18:14:36 +0000
commita5a65acc4b6cfcbf4f9143a2196cc124454597fb (patch)
tree80e4e6e43ee25571f2c1c87c6e4a2921c0b969cd /chrome/renderer/page_load_histograms.h
parentd75db806671e165128bfe89834c845283a3f283f (diff)
downloadchromium_src-a5a65acc4b6cfcbf4f9143a2196cc124454597fb.zip
chromium_src-a5a65acc4b6cfcbf4f9143a2196cc124454597fb.tar.gz
chromium_src-a5a65acc4b6cfcbf4f9143a2196cc124454597fb.tar.bz2
Factor a PageLoadHistograms class out of RenderView.
No functional changes are intended. This is in anticipation of using the new WebPerformance API: http://trac.webkit.org/changeset/68141 My strategy is this: 1. In this patch, make the most minimal change possible to the Dump() method necessary to factor it out to a new class. 2. Add a new, temporary histograms which log the WebPerformance metrics which have an existing counterparts. 3. Once we understand any differences and are happy with the new metrics, rip out the old ones. This will allow more cleanup in RenderView and NavigationState. 4. Add new histograms for any interesting WebPerformance metrics which weren't previously available. BUG=none TEST=none git-svn-id: svn://svn.chromium.org/chrome/trunk/src@65223 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/page_load_histograms.h')
-rw-r--r--chrome/renderer/page_load_histograms.h59
1 files changed, 59 insertions, 0 deletions
diff --git a/chrome/renderer/page_load_histograms.h b/chrome/renderer/page_load_histograms.h
new file mode 100644
index 0000000..f7cf07a
--- /dev/null
+++ b/chrome/renderer/page_load_histograms.h
@@ -0,0 +1,59 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_RENDERER_PAGE_LOAD_HISTOGRAMS_H_
+#define CHROME_RENDERER_PAGE_LOAD_HISTOGRAMS_H_
+
+#include "base/basictypes.h"
+
+class NavigationState;
+
+namespace WebKit {
+class WebDataSource;
+class WebFrame;
+}
+
+class PageLoadHistograms {
+ public:
+ PageLoadHistograms();
+
+ // Dump all page load histograms appropriate for the given frame.
+ //
+ // This method will only dump once-per-instance, so it is safe to call
+ // multiple times.
+ //
+ // The time points we keep are
+ // request: time document was requested by user
+ // start: time load of document started
+ // commit: time load of document started
+ // finish_document: main document loaded, before onload()
+ // finish_all_loads: after onload() and all resources are loaded
+ // first_paint: first paint performed
+ // first_paint_after_load: first paint performed after load is finished
+ // begin: request if it was user requested, start otherwise
+ //
+ // It's possible for the request time not to be set, if a client
+ // redirect had been done (the user never requested the page)
+ // Also, it's possible to load a page without ever laying it out
+ // so first_paint and first_paint_after_load can be 0.
+ void Dump(WebKit::WebFrame* frame);
+
+ void IncrementCrossFramePropertyAccess(bool cross_origin);
+ void ResetCrossFramePropertyAccess();
+
+ private:
+ void LogPageLoadTime(const NavigationState* state,
+ const WebKit::WebDataSource* ds) const;
+
+ bool has_dumped_;
+
+ // Site isolation metric counts.
+ // These are per-page-load counts, reset to 0 after they are dumped.
+ int cross_origin_access_count_;
+ int same_origin_access_count_;
+
+ DISALLOW_COPY_AND_ASSIGN(PageLoadHistograms);
+};
+
+#endif // CHROME_RENDERER_PAGE_LOAD_HISTOGRAMS_H_