| OLD | NEW |
| 1 // Copyright (c) 2012 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_BROWSER_NET_LOAD_TIME_STATS_H_ | 5 #ifndef CHROME_BROWSER_NET_LOAD_TIME_STATS_H_ |
| 6 #define CHROME_BROWSER_NET_LOAD_TIME_STATS_H_ | 6 #define CHROME_BROWSER_NET_LOAD_TIME_STATS_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 // spinner starts or stops for it, and whenever a renderer is no longer used. | 121 // spinner starts or stops for it, and whenever a renderer is no longer used. |
| 122 class LoadTimeStatsTabHelper | 122 class LoadTimeStatsTabHelper |
| 123 : public content::WebContentsObserver, | 123 : public content::WebContentsObserver, |
| 124 public content::WebContentsUserData<LoadTimeStatsTabHelper> { | 124 public content::WebContentsUserData<LoadTimeStatsTabHelper> { |
| 125 public: | 125 public: |
| 126 virtual ~LoadTimeStatsTabHelper(); | 126 virtual ~LoadTimeStatsTabHelper(); |
| 127 | 127 |
| 128 // content::WebContentsObserver implementation | 128 // content::WebContentsObserver implementation |
| 129 virtual void DidStartProvisionalLoadForFrame( | 129 virtual void DidStartProvisionalLoadForFrame( |
| 130 int64 frame_id, | 130 int64 frame_id, |
| 131 int64 parent_frame_id, |
| 131 bool is_main_frame, | 132 bool is_main_frame, |
| 132 const GURL& validated_url, | 133 const GURL& validated_url, |
| 133 bool is_error_page, | 134 bool is_error_page, |
| 134 content::RenderViewHost* render_view_host) OVERRIDE; | 135 content::RenderViewHost* render_view_host) OVERRIDE; |
| 135 virtual void DidStopLoading( | 136 virtual void DidStopLoading( |
| 136 content::RenderViewHost* render_view_host) OVERRIDE; | 137 content::RenderViewHost* render_view_host) OVERRIDE; |
| 137 | 138 |
| 138 private: | 139 private: |
| 139 explicit LoadTimeStatsTabHelper(content::WebContents* web_contents); | 140 explicit LoadTimeStatsTabHelper(content::WebContents* web_contents); |
| 140 friend class content::WebContentsUserData<LoadTimeStatsTabHelper>; | 141 friend class content::WebContentsUserData<LoadTimeStatsTabHelper>; |
| 141 | 142 |
| 142 // Calls into LoadTimeStats to notify that a reportable event has occurred | 143 // Calls into LoadTimeStats to notify that a reportable event has occurred |
| 143 // for the tab being observed. | 144 // for the tab being observed. |
| 144 void NotifyLoadTimeStats(LoadTimeStats::TabEvent event, | 145 void NotifyLoadTimeStats(LoadTimeStats::TabEvent event, |
| 145 content::RenderViewHost* render_view_host); | 146 content::RenderViewHost* render_view_host); |
| 146 | 147 |
| 147 bool is_otr_profile_; | 148 bool is_otr_profile_; |
| 148 | 149 |
| 149 DISALLOW_COPY_AND_ASSIGN(LoadTimeStatsTabHelper); | 150 DISALLOW_COPY_AND_ASSIGN(LoadTimeStatsTabHelper); |
| 150 }; | 151 }; |
| 151 | 152 |
| 152 } // namespace chrome_browser_net | 153 } // namespace chrome_browser_net |
| 153 | 154 |
| 154 #endif // CHROME_BROWSER_NET_LOAD_TIME_STATS_H_ | 155 #endif // CHROME_BROWSER_NET_LOAD_TIME_STATS_H_ |
| OLD | NEW |