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

Unified Diff: components/ukm/ukm_source.h

Issue 2649303004: UKM: Added support for navigation sources (Closed)
Patch Set: Histogram description 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
« no previous file with comments | « components/ukm/ukm_service_unittest.cc ('k') | components/ukm/ukm_source.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/ukm/ukm_source.h
diff --git a/components/ukm/ukm_source.h b/components/ukm/ukm_source.h
new file mode 100644
index 0000000000000000000000000000000000000000..32b2a8efc8c885a672c0db81d252b3a3aec53b0b
--- /dev/null
+++ b/components/ukm/ukm_source.h
@@ -0,0 +1,54 @@
+// 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.
+
+#ifndef COMPONENTS_UKM_UKM_SOURCE_H_
+#define COMPONENTS_UKM_UKM_SOURCE_H_
+
+#include <stddef.h>
+
+#include "base/macros.h"
+#include "base/time/time.h"
+#include "url/gurl.h"
+
+namespace ukm {
+
+class Source;
+
+// Contains UKM data for a single navigation entry.
+class UkmSource {
+ public:
+ UkmSource();
+ ~UkmSource();
+
+ const GURL& committed_url() const { return committed_url_; }
+ void set_committed_url(const GURL& committed_url) {
+ committed_url_ = committed_url;
+ }
+
+ base::Time navigation_start() const { return navigation_start_; }
+ void set_navigation_start(base::Time navigation_start) {
+ navigation_start_ = navigation_start;
+ }
+
+ base::TimeDelta first_contentful_paint() const {
+ return first_contentful_paint_;
+ }
+ void set_first_contentful_paint(base::TimeDelta first_contentful_paint) {
+ first_contentful_paint_ = first_contentful_paint;
+ }
+
+ // Serializes the members of the class into the supplied proto.
+ void PopulateProto(Source* proto_source);
+
+ private:
+ GURL committed_url_;
+ base::Time navigation_start_;
+ base::TimeDelta first_contentful_paint_;
+
+ DISALLOW_COPY_AND_ASSIGN(UkmSource);
+};
+
+} // namespace ukm
+
+#endif // COMPONENTS_UKM_UKM_SOURCE_H_
« no previous file with comments | « components/ukm/ukm_service_unittest.cc ('k') | components/ukm/ukm_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698