OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_RENDERER_PAGE_LOAD_HISTOGRAMS_H_ | 5 #ifndef CHROME_RENDERER_PAGE_LOAD_HISTOGRAMS_H_ |
6 #define CHROME_RENDERER_PAGE_LOAD_HISTOGRAMS_H_ | 6 #define CHROME_RENDERER_PAGE_LOAD_HISTOGRAMS_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "content/public/renderer/render_view_observer.h" | 9 #include "content/public/renderer/render_view_observer.h" |
10 | 10 |
11 namespace content { | 11 namespace content { |
12 class DocumentState; | 12 class DocumentState; |
13 } | 13 } |
14 | 14 |
15 class RendererHistogramSnapshots; | 15 namespace base { |
| 16 class HistogramSender; |
| 17 } |
16 | 18 |
17 class PageLoadHistograms : public content::RenderViewObserver { | 19 class PageLoadHistograms : public content::RenderViewObserver { |
18 public: | 20 public: |
19 PageLoadHistograms(content::RenderView* render_view, | 21 PageLoadHistograms(content::RenderView* render_view, |
20 RendererHistogramSnapshots* histogram_snapshots); | 22 base::HistogramSender* histogram_sender); |
21 | 23 |
22 private: | 24 private: |
23 // RenderViewObserver implementation. | 25 // RenderViewObserver implementation. |
24 virtual void FrameWillClose(WebKit::WebFrame* frame) OVERRIDE; | 26 virtual void FrameWillClose(WebKit::WebFrame* frame) OVERRIDE; |
25 virtual void ClosePage() OVERRIDE; | 27 virtual void ClosePage() OVERRIDE; |
26 | 28 |
27 // Dump all page load histograms appropriate for the given frame. | 29 // Dump all page load histograms appropriate for the given frame. |
28 // | 30 // |
29 // This method will only dump once-per-instance, so it is safe to call | 31 // This method will only dump once-per-instance, so it is safe to call |
30 // multiple times. | 32 // multiple times. |
(...skipping 17 matching lines...) Expand all Loading... |
48 void ResetCrossFramePropertyAccess(); | 50 void ResetCrossFramePropertyAccess(); |
49 | 51 |
50 void LogPageLoadTime(const content::DocumentState* load_times, | 52 void LogPageLoadTime(const content::DocumentState* load_times, |
51 const WebKit::WebDataSource* ds) const; | 53 const WebKit::WebDataSource* ds) const; |
52 | 54 |
53 // Site isolation metric counts. | 55 // Site isolation metric counts. |
54 // These are per-page-load counts, reset to 0 after they are dumped. | 56 // These are per-page-load counts, reset to 0 after they are dumped. |
55 int cross_origin_access_count_; | 57 int cross_origin_access_count_; |
56 int same_origin_access_count_; | 58 int same_origin_access_count_; |
57 | 59 |
58 RendererHistogramSnapshots* histogram_snapshots_; | 60 base::HistogramSender* histogram_sender_; |
59 | 61 |
60 DISALLOW_COPY_AND_ASSIGN(PageLoadHistograms); | 62 DISALLOW_COPY_AND_ASSIGN(PageLoadHistograms); |
61 }; | 63 }; |
62 | 64 |
63 #endif // CHROME_RENDERER_PAGE_LOAD_HISTOGRAMS_H_ | 65 #endif // CHROME_RENDERER_PAGE_LOAD_HISTOGRAMS_H_ |
OLD | NEW |