| 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/navigation_state.h" |
| 9 #include "content/public/renderer/render_view_observer.h" | 10 #include "content/public/renderer/render_view_observer.h" |
| 10 | 11 |
| 11 class RendererHistogramSnapshots; | 12 class RendererHistogramSnapshots; |
| 12 | 13 |
| 13 namespace content { | |
| 14 class NavigationState; | |
| 15 } | |
| 16 | |
| 17 class PageLoadHistograms : public content::RenderViewObserver { | 14 class PageLoadHistograms : public content::RenderViewObserver { |
| 18 public: | 15 public: |
| 19 PageLoadHistograms(content::RenderView* render_view, | 16 PageLoadHistograms(content::RenderView* render_view, |
| 20 RendererHistogramSnapshots* histogram_snapshots); | 17 RendererHistogramSnapshots* histogram_snapshots); |
| 21 | 18 |
| 22 private: | 19 private: |
| 23 // RenderViewObserver implementation. | 20 // RenderViewObserver implementation. |
| 24 virtual void FrameWillClose(WebKit::WebFrame* frame) OVERRIDE; | 21 virtual void FrameWillClose(WebKit::WebFrame* frame) OVERRIDE; |
| 25 virtual void ClosePage() OVERRIDE; | 22 virtual void ClosePage() OVERRIDE; |
| 26 | 23 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 40 // begin: request if it was user requested, start otherwise | 37 // begin: request if it was user requested, start otherwise |
| 41 // | 38 // |
| 42 // It's possible for the request time not to be set, if a client | 39 // It's possible for the request time not to be set, if a client |
| 43 // redirect had been done (the user never requested the page) | 40 // redirect had been done (the user never requested the page) |
| 44 // Also, it's possible to load a page without ever laying it out | 41 // Also, it's possible to load a page without ever laying it out |
| 45 // so first_paint and first_paint_after_load can be 0. | 42 // so first_paint and first_paint_after_load can be 0. |
| 46 void Dump(WebKit::WebFrame* frame); | 43 void Dump(WebKit::WebFrame* frame); |
| 47 | 44 |
| 48 void ResetCrossFramePropertyAccess(); | 45 void ResetCrossFramePropertyAccess(); |
| 49 | 46 |
| 50 void LogPageLoadTime(const content::NavigationState* state, | 47 void LogPageLoadTime(const content::NavigationState::LoadTimes* load_times, |
| 51 const WebKit::WebDataSource* ds) const; | 48 const WebKit::WebDataSource* ds) const; |
| 52 | 49 |
| 53 // Site isolation metric counts. | 50 // Site isolation metric counts. |
| 54 // These are per-page-load counts, reset to 0 after they are dumped. | 51 // These are per-page-load counts, reset to 0 after they are dumped. |
| 55 int cross_origin_access_count_; | 52 int cross_origin_access_count_; |
| 56 int same_origin_access_count_; | 53 int same_origin_access_count_; |
| 57 | 54 |
| 58 RendererHistogramSnapshots* histogram_snapshots_; | 55 RendererHistogramSnapshots* histogram_snapshots_; |
| 59 | 56 |
| 60 DISALLOW_COPY_AND_ASSIGN(PageLoadHistograms); | 57 DISALLOW_COPY_AND_ASSIGN(PageLoadHistograms); |
| 61 }; | 58 }; |
| 62 | 59 |
| 63 #endif // CHROME_RENDERER_PAGE_LOAD_HISTOGRAMS_H_ | 60 #endif // CHROME_RENDERER_PAGE_LOAD_HISTOGRAMS_H_ |
| OLD | NEW |