| 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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 timing.first_layout = ClampDelta(perf.firstLayout(), start); | 131 timing.first_layout = ClampDelta(perf.firstLayout(), start); |
| 132 if (perf.firstPaint() > 0.0) | 132 if (perf.firstPaint() > 0.0) |
| 133 timing.first_paint = ClampDelta(perf.firstPaint(), start); | 133 timing.first_paint = ClampDelta(perf.firstPaint(), start); |
| 134 if (perf.firstTextPaint() > 0.0) | 134 if (perf.firstTextPaint() > 0.0) |
| 135 timing.first_text_paint = ClampDelta(perf.firstTextPaint(), start); | 135 timing.first_text_paint = ClampDelta(perf.firstTextPaint(), start); |
| 136 if (perf.firstImagePaint() > 0.0) | 136 if (perf.firstImagePaint() > 0.0) |
| 137 timing.first_image_paint = ClampDelta(perf.firstImagePaint(), start); | 137 timing.first_image_paint = ClampDelta(perf.firstImagePaint(), start); |
| 138 if (perf.firstContentfulPaint() > 0.0) | 138 if (perf.firstContentfulPaint() > 0.0) |
| 139 timing.first_contentful_paint = | 139 timing.first_contentful_paint = |
| 140 ClampDelta(perf.firstContentfulPaint(), start); | 140 ClampDelta(perf.firstContentfulPaint(), start); |
| 141 if (perf.firstMeaningfulPaint() > 0.0) |
| 142 timing.first_meaningful_paint = |
| 143 ClampDelta(perf.firstMeaningfulPaint(), start); |
| 141 if (perf.parseStart() > 0.0) | 144 if (perf.parseStart() > 0.0) |
| 142 timing.parse_start = ClampDelta(perf.parseStart(), start); | 145 timing.parse_start = ClampDelta(perf.parseStart(), start); |
| 143 if (perf.parseStop() > 0.0) | 146 if (perf.parseStop() > 0.0) |
| 144 timing.parse_stop = ClampDelta(perf.parseStop(), start); | 147 timing.parse_stop = ClampDelta(perf.parseStop(), start); |
| 145 if (timing.parse_start) { | 148 if (timing.parse_start) { |
| 146 // If we started parsing, record all parser durations such as the amount of | 149 // If we started parsing, record all parser durations such as the amount of |
| 147 // time blocked on script load, even if those values are zero. | 150 // time blocked on script load, even if those values are zero. |
| 148 timing.parse_blocked_on_script_load_duration = | 151 timing.parse_blocked_on_script_load_duration = |
| 149 base::TimeDelta::FromSecondsD(perf.parseBlockedOnScriptLoadDuration()); | 152 base::TimeDelta::FromSecondsD(perf.parseBlockedOnScriptLoadDuration()); |
| 150 timing.parse_blocked_on_script_load_from_document_write_duration = | 153 timing.parse_blocked_on_script_load_from_document_write_duration = |
| (...skipping 11 matching lines...) Expand all Loading... |
| 162 bool no_frame = !render_frame() || !render_frame()->GetWebFrame(); | 165 bool no_frame = !render_frame() || !render_frame()->GetWebFrame(); |
| 163 DCHECK(!no_frame); | 166 DCHECK(!no_frame); |
| 164 return no_frame; | 167 return no_frame; |
| 165 } | 168 } |
| 166 | 169 |
| 167 void MetricsRenderFrameObserver::OnDestruct() { | 170 void MetricsRenderFrameObserver::OnDestruct() { |
| 168 delete this; | 171 delete this; |
| 169 } | 172 } |
| 170 | 173 |
| 171 } // namespace page_load_metrics | 174 } // namespace page_load_metrics |
| OLD | NEW |