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/bind.h" | 7 #include "base/bind.h" |
8 #include "base/metrics/histogram_macros.h" | 8 #include "base/metrics/histogram_macros.h" |
9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
10 #include "chrome/browser/prerender/prerender_histograms.h" | 10 #include "chrome/browser/prerender/prerender_histograms.h" |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 } | 97 } |
98 | 98 |
99 // Reset the PPLT metric. | 99 // Reset the PPLT metric. |
100 pplt_load_start_ = base::TimeTicks(); | 100 pplt_load_start_ = base::TimeTicks(); |
101 actual_load_start_ = base::TimeTicks(); | 101 actual_load_start_ = base::TimeTicks(); |
102 } | 102 } |
103 | 103 |
104 void PrerenderTabHelper::DidStartProvisionalLoadForFrame( | 104 void PrerenderTabHelper::DidStartProvisionalLoadForFrame( |
105 content::RenderFrameHost* render_frame_host, | 105 content::RenderFrameHost* render_frame_host, |
106 const GURL& validated_url, | 106 const GURL& validated_url, |
107 bool is_error_page) { | 107 bool is_error_page, |
| 108 bool is_iframe_srcdoc) { |
108 if (render_frame_host->GetParent()) | 109 if (render_frame_host->GetParent()) |
109 return; | 110 return; |
110 | 111 |
111 // Record PPLT state for the beginning of a new navigation. | 112 // Record PPLT state for the beginning of a new navigation. |
112 pplt_load_start_ = GetTimeTicksFromPrerenderManager(); | 113 pplt_load_start_ = GetTimeTicksFromPrerenderManager(); |
113 actual_load_start_ = base::TimeTicks(); | 114 actual_load_start_ = base::TimeTicks(); |
114 | 115 |
115 if (next_load_is_control_prerender_) { | 116 if (next_load_is_control_prerender_) { |
116 DCHECK_EQ(NAVIGATION_TYPE_NORMAL, navigation_type_); | 117 DCHECK_EQ(NAVIGATION_TYPE_NORMAL, navigation_type_); |
117 navigation_type_ = NAVIGATION_TYPE_WOULD_HAVE_BEEN_PRERENDERED; | 118 navigation_type_ = NAVIGATION_TYPE_WOULD_HAVE_BEEN_PRERENDERED; |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 prerender_manager->RecordPerceivedPageLoadTime( | 188 prerender_manager->RecordPerceivedPageLoadTime( |
188 origin_, navigation_type_, perceived_page_load_time, | 189 origin_, navigation_type_, perceived_page_load_time, |
189 fraction_plt_elapsed_at_swap_in, url_); | 190 fraction_plt_elapsed_at_swap_in, url_); |
190 | 191 |
191 // Reset state for the next navigation. | 192 // Reset state for the next navigation. |
192 navigation_type_ = NAVIGATION_TYPE_NORMAL; | 193 navigation_type_ = NAVIGATION_TYPE_NORMAL; |
193 origin_ = ORIGIN_NONE; | 194 origin_ = ORIGIN_NONE; |
194 } | 195 } |
195 | 196 |
196 } // namespace prerender | 197 } // namespace prerender |
OLD | NEW |