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

Unified Diff: components/ukm/ukm_source.h

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
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..4720770be9cc782c67524eb0f617a9b777bab0e6
--- /dev/null
+++ b/components/ukm/ukm_source.h
@@ -0,0 +1,53 @@
+// 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(const base::Time& navigation_start) {
+ navigation_start_ = navigation_start;
+ }
+
+ base::TimeDelta first_contentful_paint() const {
+ return first_contentful_paint_;
+ }
+ void set_first_contentful_paint(
+ const 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_;
+};
+
+} // namespace ukm
+
+#endif // COMPONENTS_UKM_UKM_SOURCE_H_

Powered by Google App Engine
This is Rietveld 408576698