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 #include "chrome/browser/prerender/prerender_tab_helper.h" | 5 #include "chrome/browser/prerender/prerender_tab_helper.h" |
6 | 6 |
7 #include "base/metrics/histogram.h" | 7 #include "base/metrics/histogram.h" |
8 #include "base/string_number_conversions.h" | 8 #include "base/string_number_conversions.h" |
9 #include "base/time.h" | 9 #include "base/time.h" |
10 #include "chrome/browser/prerender/prerender_histograms.h" | 10 #include "chrome/browser/prerender/prerender_histograms.h" |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 // and the WebContents that it was swapped into. | 124 // and the WebContents that it was swapped into. |
125 scoped_ptr<SkBitmap> bitmap_; | 125 scoped_ptr<SkBitmap> bitmap_; |
126 WebContents* bitmap_web_contents_; | 126 WebContents* bitmap_web_contents_; |
127 | 127 |
128 base::WeakPtrFactory<PixelStats> weak_factory_; | 128 base::WeakPtrFactory<PixelStats> weak_factory_; |
129 | 129 |
130 PrerenderTabHelper* tab_helper_; | 130 PrerenderTabHelper* tab_helper_; |
131 }; | 131 }; |
132 | 132 |
133 PrerenderTabHelper::PrerenderTabHelper(TabContents* tab) | 133 PrerenderTabHelper::PrerenderTabHelper(TabContents* tab) |
134 : content::WebContentsObserver(tab->web_contents()), | 134 : content::WebContentsObserver(tab->web_contents()) { |
135 tab_(tab) { | |
136 } | 135 } |
137 | 136 |
138 PrerenderTabHelper::~PrerenderTabHelper() { | 137 PrerenderTabHelper::~PrerenderTabHelper() { |
139 } | 138 } |
140 | 139 |
141 void PrerenderTabHelper::ProvisionalChangeToMainFrameUrl( | 140 void PrerenderTabHelper::ProvisionalChangeToMainFrameUrl( |
142 const GURL& url, | 141 const GURL& url, |
143 const GURL& opener_url, | 142 const GURL& opener_url, |
144 content::RenderViewHost* render_view_host) { | 143 content::RenderViewHost* render_view_host) { |
145 url_ = url; | 144 url_ = url; |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 // If we have not finished loading yet, record the actual load start, and | 244 // If we have not finished loading yet, record the actual load start, and |
246 // rebase the start time to now. | 245 // rebase the start time to now. |
247 actual_load_start_ = pplt_load_start_; | 246 actual_load_start_ = pplt_load_start_; |
248 pplt_load_start_ = base::TimeTicks::Now(); | 247 pplt_load_start_ = base::TimeTicks::Now(); |
249 if (pixel_stats_.get()) | 248 if (pixel_stats_.get()) |
250 pixel_stats_->GetBitmap(PixelStats::BITMAP_SWAP_IN, web_contents()); | 249 pixel_stats_->GetBitmap(PixelStats::BITMAP_SWAP_IN, web_contents()); |
251 } | 250 } |
252 } | 251 } |
253 | 252 |
254 } // namespace prerender | 253 } // namespace prerender |
OLD | NEW |