Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(786)

Unified Diff: components/ukm/ukm_source.cc

Issue 2717413003: Add support for logging additional metrics in UKM. (Closed)
Patch Set: record URL at nav start Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/ukm/ukm_source.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/ukm/ukm_source.cc
diff --git a/components/ukm/ukm_source.cc b/components/ukm/ukm_source.cc
index dc2f9e033a4f84435e34b0adf0892b661c9a01d9..d0c51f97a6199cfc7d3b4c7d97f3f3c917c64475 100644
--- a/components/ukm/ukm_source.cc
+++ b/components/ukm/ukm_source.cc
@@ -12,10 +12,21 @@ UkmSource::UkmSource() = default;
UkmSource::~UkmSource() = default;
void UkmSource::PopulateProto(Source* proto_source) {
- proto_source->set_url(committed_url_.spec());
+ proto_source->set_url(url_.spec());
- proto_source->set_first_contentful_paint_msec(
- first_contentful_paint_.InMilliseconds());
+ if (parse_start_)
+ proto_source->set_parse_start_msec(parse_start_.value().InMilliseconds());
+ if (total_time_)
+ proto_source->set_total_time_msec(total_time_.value().InMilliseconds());
+
+ if (first_contentful_paint_) {
+ proto_source->set_first_contentful_paint_msec(
+ first_contentful_paint_.value().InMilliseconds());
+ }
+ if (first_meaningful_paint_) {
+ proto_source->set_experimental_first_meaningful_paint_msec(
+ first_meaningful_paint_.value().InMilliseconds());
+ }
}
} // namespace ukm
« no previous file with comments | « components/ukm/ukm_source.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698