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

Unified Diff: components/ukm/ukm_source.cc

Issue 2649303004: UKM: Added support for navigation sources (Closed)
Patch Set: Created 3 years, 11 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
« components/ukm/ukm_service_unittest.cc ('K') | « 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
new file mode 100644
index 0000000000000000000000000000000000000000..ca0fc0a49da8b1a847cd9b400e05e88d1432bebb
--- /dev/null
+++ b/components/ukm/ukm_source.cc
@@ -0,0 +1,26 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "components/ukm/ukm_source.h"
+#include "components/metrics/proto/ukm/source.pb.h"
+
+namespace ukm {
+
+UkmSource::UkmSource() = default;
+
+UkmSource::~UkmSource() = default;
+
+void UkmSource::PopulateProto(Source* proto_source) {
+ proto_source->set_url(committed_url_.spec());
+
+ base::TimeDelta navigation_start_in_msec =
+ navigation_start_ - base::Time::UnixEpoch();
+ proto_source->set_navigation_time_msec(
+ navigation_start_in_msec.InMilliseconds());
+
+ proto_source->set_first_contentful_paint_msec(
+ first_contentful_paint_.InMilliseconds());
+}
+
+} // namespace ukm
« components/ukm/ukm_service_unittest.cc ('K') | « components/ukm/ukm_source.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698