| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 class RendererHistogramSnapshots; | 11 class RendererHistogramSnapshots; |
| 12 | 12 |
| 13 namespace content { | 13 namespace content { |
| 14 class NavigationState; | 14 class NavigationState; |
| 15 } | 15 } |
| 16 | 16 |
| 17 class PageLoadHistograms : public content::RenderViewObserver { | 17 class PageLoadHistograms : public content::RenderViewObserver { |
| 18 public: | 18 public: |
| 19 PageLoadHistograms(content::RenderView* render_view, | 19 PageLoadHistograms(content::RenderView* render_view, |
| 20 RendererHistogramSnapshots* histogram_snapshots); | 20 RendererHistogramSnapshots* histogram_snapshots); |
| 21 | 21 |
| 22 private: | 22 private: |
| 23 // RenderViewObserver implementation. | 23 // RenderViewObserver implementation. |
| 24 virtual void FrameWillClose(WebKit::WebFrame* frame); | 24 virtual void FrameWillClose(WebKit::WebFrame* frame) OVERRIDE; |
| 25 virtual bool OnMessageReceived(const IPC::Message& message); | 25 virtual void ClosePage() OVERRIDE; |
| 26 | 26 |
| 27 // Dump all page load histograms appropriate for the given frame. | 27 // Dump all page load histograms appropriate for the given frame. |
| 28 // | 28 // |
| 29 // This method will only dump once-per-instance, so it is safe to call | 29 // This method will only dump once-per-instance, so it is safe to call |
| 30 // multiple times. | 30 // multiple times. |
| 31 // | 31 // |
| 32 // The time points we keep are | 32 // The time points we keep are |
| 33 // request: time document was requested by user | 33 // request: time document was requested by user |
| 34 // start: time load of document started | 34 // start: time load of document started |
| 35 // commit: time load of document started | 35 // commit: time load of document started |
| (...skipping 18 matching lines...) Expand all Loading... |
| 54 // These are per-page-load counts, reset to 0 after they are dumped. | 54 // These are per-page-load counts, reset to 0 after they are dumped. |
| 55 int cross_origin_access_count_; | 55 int cross_origin_access_count_; |
| 56 int same_origin_access_count_; | 56 int same_origin_access_count_; |
| 57 | 57 |
| 58 RendererHistogramSnapshots* histogram_snapshots_; | 58 RendererHistogramSnapshots* histogram_snapshots_; |
| 59 | 59 |
| 60 DISALLOW_COPY_AND_ASSIGN(PageLoadHistograms); | 60 DISALLOW_COPY_AND_ASSIGN(PageLoadHistograms); |
| 61 }; | 61 }; |
| 62 | 62 |
| 63 #endif // CHROME_RENDERER_PAGE_LOAD_HISTOGRAMS_H_ | 63 #endif // CHROME_RENDERER_PAGE_LOAD_HISTOGRAMS_H_ |
| OLD | NEW |