Chromium Code Reviews| 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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 133 timing.first_layout = ClampDelta(perf.firstLayout(), start); | 133 timing.first_layout = ClampDelta(perf.firstLayout(), start); |
| 134 if (perf.firstPaint() > 0.0) | 134 if (perf.firstPaint() > 0.0) |
| 135 timing.first_paint = ClampDelta(perf.firstPaint(), start); | 135 timing.first_paint = ClampDelta(perf.firstPaint(), start); |
| 136 if (perf.firstTextPaint() > 0.0) | 136 if (perf.firstTextPaint() > 0.0) |
| 137 timing.first_text_paint = ClampDelta(perf.firstTextPaint(), start); | 137 timing.first_text_paint = ClampDelta(perf.firstTextPaint(), start); |
| 138 if (perf.firstImagePaint() > 0.0) | 138 if (perf.firstImagePaint() > 0.0) |
| 139 timing.first_image_paint = ClampDelta(perf.firstImagePaint(), start); | 139 timing.first_image_paint = ClampDelta(perf.firstImagePaint(), start); |
| 140 if (perf.firstContentfulPaint() > 0.0) | 140 if (perf.firstContentfulPaint() > 0.0) |
| 141 timing.first_contentful_paint = | 141 timing.first_contentful_paint = |
| 142 ClampDelta(perf.firstContentfulPaint(), start); | 142 ClampDelta(perf.firstContentfulPaint(), start); |
| 143 if (perf.firstMeaningfulPaint() > 0.0) | |
|
Charlie Harrison
2016/08/04 02:18:29
nit: Can you wrap the if with braces? I'm not a fa
Kunihiko Sakamoto
2016/08/04 02:56:14
Done.
| |
| 144 timing.first_meaningful_paint = | |
| 145 ClampDelta(perf.firstMeaningfulPaint(), start); | |
| 143 if (perf.parseStart() > 0.0) | 146 if (perf.parseStart() > 0.0) |
| 144 timing.parse_start = ClampDelta(perf.parseStart(), start); | 147 timing.parse_start = ClampDelta(perf.parseStart(), start); |
| 145 if (perf.parseStop() > 0.0) | 148 if (perf.parseStop() > 0.0) |
| 146 timing.parse_stop = ClampDelta(perf.parseStop(), start); | 149 timing.parse_stop = ClampDelta(perf.parseStop(), start); |
| 147 if (timing.parse_start) { | 150 if (timing.parse_start) { |
| 148 // If we started parsing, record all parser durations such as the amount of | 151 // If we started parsing, record all parser durations such as the amount of |
| 149 // time blocked on script load, even if those values are zero. | 152 // time blocked on script load, even if those values are zero. |
| 150 timing.parse_blocked_on_script_load_duration = | 153 timing.parse_blocked_on_script_load_duration = |
| 151 base::TimeDelta::FromSecondsD(perf.parseBlockedOnScriptLoadDuration()); | 154 base::TimeDelta::FromSecondsD(perf.parseBlockedOnScriptLoadDuration()); |
| 152 timing.parse_blocked_on_script_load_from_document_write_duration = | 155 timing.parse_blocked_on_script_load_from_document_write_duration = |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 164 bool no_frame = !render_frame() || !render_frame()->GetWebFrame(); | 167 bool no_frame = !render_frame() || !render_frame()->GetWebFrame(); |
| 165 DCHECK(!no_frame); | 168 DCHECK(!no_frame); |
| 166 return no_frame; | 169 return no_frame; |
| 167 } | 170 } |
| 168 | 171 |
| 169 void MetricsRenderFrameObserver::OnDestruct() { | 172 void MetricsRenderFrameObserver::OnDestruct() { |
| 170 delete this; | 173 delete this; |
| 171 } | 174 } |
| 172 | 175 |
| 173 } // namespace page_load_metrics | 176 } // namespace page_load_metrics |
| OLD | NEW |