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 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 pplt_load_start_ = base::TimeTicks(); | 196 pplt_load_start_ = base::TimeTicks(); |
197 actual_load_start_ = base::TimeTicks(); | 197 actual_load_start_ = base::TimeTicks(); |
198 } | 198 } |
199 | 199 |
200 void PrerenderTabHelper::DidStartProvisionalLoadForFrame( | 200 void PrerenderTabHelper::DidStartProvisionalLoadForFrame( |
201 int64 frame_id, | 201 int64 frame_id, |
202 int64 parent_frame_id, | 202 int64 parent_frame_id, |
203 bool is_main_frame, | 203 bool is_main_frame, |
204 const GURL& validated_url, | 204 const GURL& validated_url, |
205 bool is_error_page, | 205 bool is_error_page, |
| 206 bool is_iframe_srcdoc, |
206 content::RenderViewHost* render_view_host) { | 207 content::RenderViewHost* render_view_host) { |
207 if (is_main_frame) { | 208 if (is_main_frame) { |
208 // Record the beginning of a new PPLT navigation. | 209 // Record the beginning of a new PPLT navigation. |
209 pplt_load_start_ = base::TimeTicks::Now(); | 210 pplt_load_start_ = base::TimeTicks::Now(); |
210 actual_load_start_ = base::TimeTicks(); | 211 actual_load_start_ = base::TimeTicks(); |
211 } | 212 } |
212 } | 213 } |
213 | 214 |
214 PrerenderManager* PrerenderTabHelper::MaybeGetPrerenderManager() const { | 215 PrerenderManager* PrerenderTabHelper::MaybeGetPrerenderManager() const { |
215 return PrerenderManagerFactory::GetForProfile( | 216 return PrerenderManagerFactory::GetForProfile( |
(...skipping 28 matching lines...) Expand all Loading... |
244 // If we have not finished loading yet, record the actual load start, and | 245 // If we have not finished loading yet, record the actual load start, and |
245 // rebase the start time to now. | 246 // rebase the start time to now. |
246 actual_load_start_ = pplt_load_start_; | 247 actual_load_start_ = pplt_load_start_; |
247 pplt_load_start_ = base::TimeTicks::Now(); | 248 pplt_load_start_ = base::TimeTicks::Now(); |
248 if (pixel_stats_.get()) | 249 if (pixel_stats_.get()) |
249 pixel_stats_->GetBitmap(PixelStats::BITMAP_SWAP_IN, web_contents()); | 250 pixel_stats_->GetBitmap(PixelStats::BITMAP_SWAP_IN, web_contents()); |
250 } | 251 } |
251 } | 252 } |
252 | 253 |
253 } // namespace prerender | 254 } // namespace prerender |
OLD | NEW |