| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/renderer/page_load_metrics/metrics_render_frame_observer.h" | 5 #include "chrome/renderer/page_load_metrics/metrics_render_frame_observer.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 timing.first_layout = ClampDelta(perf.firstLayout(), start); | 135 timing.first_layout = ClampDelta(perf.firstLayout(), start); |
| 136 if (perf.firstPaint() > 0.0) | 136 if (perf.firstPaint() > 0.0) |
| 137 timing.first_paint = ClampDelta(perf.firstPaint(), start); | 137 timing.first_paint = ClampDelta(perf.firstPaint(), start); |
| 138 if (perf.firstTextPaint() > 0.0) | 138 if (perf.firstTextPaint() > 0.0) |
| 139 timing.first_text_paint = ClampDelta(perf.firstTextPaint(), start); | 139 timing.first_text_paint = ClampDelta(perf.firstTextPaint(), start); |
| 140 if (perf.firstImagePaint() > 0.0) | 140 if (perf.firstImagePaint() > 0.0) |
| 141 timing.first_image_paint = ClampDelta(perf.firstImagePaint(), start); | 141 timing.first_image_paint = ClampDelta(perf.firstImagePaint(), start); |
| 142 if (perf.firstContentfulPaint() > 0.0) | 142 if (perf.firstContentfulPaint() > 0.0) |
| 143 timing.first_contentful_paint = | 143 timing.first_contentful_paint = |
| 144 ClampDelta(perf.firstContentfulPaint(), start); | 144 ClampDelta(perf.firstContentfulPaint(), start); |
| 145 if (perf.firstMeaningfulPaint() > 0.0) |
| 146 timing.first_meaningful_paint = |
| 147 ClampDelta(perf.firstMeaningfulPaint(), start); |
| 145 if (perf.parseStart() > 0.0) | 148 if (perf.parseStart() > 0.0) |
| 146 timing.parse_start = ClampDelta(perf.parseStart(), start); | 149 timing.parse_start = ClampDelta(perf.parseStart(), start); |
| 147 if (perf.parseStop() > 0.0) | 150 if (perf.parseStop() > 0.0) |
| 148 timing.parse_stop = ClampDelta(perf.parseStop(), start); | 151 timing.parse_stop = ClampDelta(perf.parseStop(), start); |
| 149 if (timing.parse_start) { | 152 if (timing.parse_start) { |
| 150 // If we started parsing, record all parser durations such as the amount of | 153 // If we started parsing, record all parser durations such as the amount of |
| 151 // time blocked on script load, even if those values are zero. | 154 // time blocked on script load, even if those values are zero. |
| 152 timing.parse_blocked_on_script_load_duration = | 155 timing.parse_blocked_on_script_load_duration = |
| 153 base::TimeDelta::FromSecondsD(perf.parseBlockedOnScriptLoadDuration()); | 156 base::TimeDelta::FromSecondsD(perf.parseBlockedOnScriptLoadDuration()); |
| 154 timing.parse_blocked_on_script_load_from_document_write_duration = | 157 timing.parse_blocked_on_script_load_from_document_write_duration = |
| (...skipping 11 matching lines...) Expand all Loading... |
| 166 bool no_frame = !render_frame() || !render_frame()->GetWebFrame(); | 169 bool no_frame = !render_frame() || !render_frame()->GetWebFrame(); |
| 167 DCHECK(!no_frame); | 170 DCHECK(!no_frame); |
| 168 return no_frame; | 171 return no_frame; |
| 169 } | 172 } |
| 170 | 173 |
| 171 void MetricsRenderFrameObserver::OnDestruct() { | 174 void MetricsRenderFrameObserver::OnDestruct() { |
| 172 delete this; | 175 delete this; |
| 173 } | 176 } |
| 174 | 177 |
| 175 } // namespace page_load_metrics | 178 } // namespace page_load_metrics |
| OLD | NEW |