OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/ukm_page_load_metrics_obser
ver.h" | 5 #include "chrome/browser/page_load_metrics/observers/ukm_page_load_metrics_obser
ver.h" |
6 #include "chrome/browser/browser_process.h" | 6 #include "chrome/browser/browser_process.h" |
7 #include "chrome/browser/page_load_metrics/page_load_metrics_util.h" | 7 #include "chrome/browser/page_load_metrics/page_load_metrics_util.h" |
8 #include "components/ukm/ukm_entry_builder.h" | 8 #include "components/ukm/ukm_entry_builder.h" |
9 #include "components/ukm/ukm_service.h" | 9 #include "components/ukm/ukm_service.h" |
10 | 10 |
11 namespace internal { | 11 namespace internal { |
12 | 12 |
13 const char kUkmPageLoadEventName[] = "PageLoad"; | 13 const char kUkmPageLoadEventName[] = "PageLoad"; |
14 const char kUkmParseStartName[] = "ParseTiming.ParseStart"; | 14 const char kUkmParseStartName[] = "ParseTiming.NavigationToParseStart"; |
15 const char kUkmDomContentLoadedName[] = | 15 const char kUkmDomContentLoadedName[] = |
16 "DocumentTiming.NavigationToDOMContentLoadedEventFired"; | 16 "DocumentTiming.NavigationToDOMContentLoadedEventFired"; |
17 const char kUkmLoadEventName[] = "DocumentTiming.NavigationToLoadEventFired"; | 17 const char kUkmLoadEventName[] = "DocumentTiming.NavigationToLoadEventFired"; |
18 const char kUkmFirstContentfulPaintName[] = | 18 const char kUkmFirstContentfulPaintName[] = |
19 "PaintTiming.NavigationToFirstContentfulPaint"; | 19 "PaintTiming.NavigationToFirstContentfulPaint"; |
20 const char kUkmFirstMeaningfulPaintName[] = | 20 const char kUkmFirstMeaningfulPaintName[] = |
21 "Experimental.PaintTiming.NavigationToFirstMeaningfulPaint"; | 21 "Experimental.PaintTiming.NavigationToFirstMeaningfulPaint"; |
22 const char kUkmForegroundDurationName[] = "PageTiming.ForegroundDuration"; | 22 const char kUkmForegroundDurationName[] = "PageTiming.ForegroundDuration"; |
23 | 23 |
24 } // namespace internal | 24 } // namespace internal |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 page_load_metrics::GetInitialForegroundDuration(info, | 121 page_load_metrics::GetInitialForegroundDuration(info, |
122 app_background_time); | 122 app_background_time); |
123 if (foreground_duration) { | 123 if (foreground_duration) { |
124 std::unique_ptr<ukm::UkmEntryBuilder> builder = | 124 std::unique_ptr<ukm::UkmEntryBuilder> builder = |
125 ukm_service->GetEntryBuilder(source_id_, | 125 ukm_service->GetEntryBuilder(source_id_, |
126 internal::kUkmPageLoadEventName); | 126 internal::kUkmPageLoadEventName); |
127 builder->AddMetric(internal::kUkmForegroundDurationName, | 127 builder->AddMetric(internal::kUkmForegroundDurationName, |
128 foreground_duration.value().InMilliseconds()); | 128 foreground_duration.value().InMilliseconds()); |
129 } | 129 } |
130 } | 130 } |
OLD | NEW |