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 "components/page_load_metrics/renderer/metrics_render_frame_observer.h" | 5 #include "components/page_load_metrics/renderer/metrics_render_frame_observer.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
10 #include "base/timer/timer.h" | 10 #include "base/timer/timer.h" |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 timing.first_layout = ClampDelta(perf.firstLayout(), start); | 117 timing.first_layout = ClampDelta(perf.firstLayout(), start); |
118 timing.first_paint = ClampDelta(perf.firstPaint(), start); | 118 timing.first_paint = ClampDelta(perf.firstPaint(), start); |
119 timing.first_text_paint = ClampDelta(perf.firstTextPaint(), start); | 119 timing.first_text_paint = ClampDelta(perf.firstTextPaint(), start); |
120 timing.first_image_paint = ClampDelta(perf.firstImagePaint(), start); | 120 timing.first_image_paint = ClampDelta(perf.firstImagePaint(), start); |
121 timing.first_contentful_paint = | 121 timing.first_contentful_paint = |
122 ClampDelta(perf.firstContentfulPaint(), start); | 122 ClampDelta(perf.firstContentfulPaint(), start); |
123 timing.parse_start = ClampDelta(perf.parseStart(), start); | 123 timing.parse_start = ClampDelta(perf.parseStart(), start); |
124 timing.parse_stop = ClampDelta(perf.parseStop(), start); | 124 timing.parse_stop = ClampDelta(perf.parseStop(), start); |
125 timing.parse_blocked_on_script_load_duration = | 125 timing.parse_blocked_on_script_load_duration = |
126 base::TimeDelta::FromSecondsD(perf.parseBlockedOnScriptLoadDuration()); | 126 base::TimeDelta::FromSecondsD(perf.parseBlockedOnScriptLoadDuration()); |
| 127 timing.parse_blocked_on_script_load_from_document_write_duration = |
| 128 base::TimeDelta::FromSecondsD( |
| 129 perf.parseBlockedOnScriptLoadFromDocumentWriteDuration()); |
127 return timing; | 130 return timing; |
128 } | 131 } |
129 | 132 |
130 scoped_ptr<base::Timer> MetricsRenderFrameObserver::CreateTimer() const { | 133 scoped_ptr<base::Timer> MetricsRenderFrameObserver::CreateTimer() const { |
131 return make_scoped_ptr(new base::OneShotTimer); | 134 return make_scoped_ptr(new base::OneShotTimer); |
132 } | 135 } |
133 | 136 |
134 bool MetricsRenderFrameObserver::HasNoRenderFrame() const { | 137 bool MetricsRenderFrameObserver::HasNoRenderFrame() const { |
135 bool no_frame = !render_frame() || !render_frame()->GetWebFrame(); | 138 bool no_frame = !render_frame() || !render_frame()->GetWebFrame(); |
136 DCHECK(!no_frame); | 139 DCHECK(!no_frame); |
137 return no_frame; | 140 return no_frame; |
138 } | 141 } |
139 | 142 |
140 } // namespace page_load_metrics | 143 } // namespace page_load_metrics |
OLD | NEW |