OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/page_load_metrics/observers/amp_page_load_metrics_obser
ver.h" | 5 #include "chrome/browser/page_load_metrics/observers/amp_page_load_metrics_obser
ver.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/optional.h" | 9 #include "base/optional.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 const page_load_metrics::PageLoadTiming& timing, | 87 const page_load_metrics::PageLoadTiming& timing, |
88 const page_load_metrics::PageLoadExtraInfo& info) { | 88 const page_load_metrics::PageLoadExtraInfo& info) { |
89 if (!WasStartedInForegroundOptionalEventInForeground( | 89 if (!WasStartedInForegroundOptionalEventInForeground( |
90 timing.document_timing.first_layout, info)) { | 90 timing.document_timing.first_layout, info)) { |
91 return; | 91 return; |
92 } | 92 } |
93 PAGE_LOAD_HISTOGRAM(kHistogramAMPFirstLayout, | 93 PAGE_LOAD_HISTOGRAM(kHistogramAMPFirstLayout, |
94 timing.document_timing.first_layout.value()); | 94 timing.document_timing.first_layout.value()); |
95 } | 95 } |
96 | 96 |
97 void AMPPageLoadMetricsObserver::OnFirstContentfulPaint( | 97 void AMPPageLoadMetricsObserver::OnFirstContentfulPaintInPage( |
98 const page_load_metrics::PageLoadTiming& timing, | 98 const page_load_metrics::PageLoadTiming& timing, |
99 const page_load_metrics::PageLoadExtraInfo& info) { | 99 const page_load_metrics::PageLoadExtraInfo& info) { |
100 if (!WasStartedInForegroundOptionalEventInForeground( | 100 if (!WasStartedInForegroundOptionalEventInForeground( |
101 timing.paint_timing.first_contentful_paint, info)) { | 101 timing.paint_timing.first_contentful_paint, info)) { |
102 return; | 102 return; |
103 } | 103 } |
104 PAGE_LOAD_HISTOGRAM(kHistogramAMPFirstContentfulPaint, | 104 PAGE_LOAD_HISTOGRAM(kHistogramAMPFirstContentfulPaint, |
105 timing.paint_timing.first_contentful_paint.value()); | 105 timing.paint_timing.first_contentful_paint.value()); |
106 } | 106 } |
107 | 107 |
108 void AMPPageLoadMetricsObserver::OnParseStart( | 108 void AMPPageLoadMetricsObserver::OnParseStart( |
109 const page_load_metrics::PageLoadTiming& timing, | 109 const page_load_metrics::PageLoadTiming& timing, |
110 const page_load_metrics::PageLoadExtraInfo& info) { | 110 const page_load_metrics::PageLoadExtraInfo& info) { |
111 if (!WasStartedInForegroundOptionalEventInForeground( | 111 if (!WasStartedInForegroundOptionalEventInForeground( |
112 timing.parse_timing.parse_start, info)) { | 112 timing.parse_timing.parse_start, info)) { |
113 return; | 113 return; |
114 } | 114 } |
115 PAGE_LOAD_HISTOGRAM(kHistogramAMPParseStart, | 115 PAGE_LOAD_HISTOGRAM(kHistogramAMPParseStart, |
116 timing.parse_timing.parse_start.value()); | 116 timing.parse_timing.parse_start.value()); |
117 } | 117 } |
OLD | NEW |