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

Side by Side Diff: components/ukm/ukm_source.h

Issue 2719823003: Convert first contentful paint logging to the new UKM client API (Closed)
Patch Set: renames Created 3 years, 9 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 unified diff | Download patch
« no previous file with comments | « components/ukm/ukm_service.cc ('k') | components/ukm/ukm_source.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef COMPONENTS_UKM_UKM_SOURCE_H_ 5 #ifndef COMPONENTS_UKM_UKM_SOURCE_H_
6 #define COMPONENTS_UKM_UKM_SOURCE_H_ 6 #define COMPONENTS_UKM_UKM_SOURCE_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <map> 9 #include <map>
10 10
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "base/time/time.h" 12 #include "base/time/time.h"
13 #include "url/gurl.h" 13 #include "url/gurl.h"
14 14
15 namespace ukm { 15 namespace ukm {
16 16
17 class Source; 17 class Source;
18 18
19 // Contains UKM data for a single navigation entry. 19 // Contains UKM data for a single navigation entry.
20 class UkmSource { 20 class UkmSource {
21 public: 21 public:
22 UkmSource(); 22 UkmSource();
23 ~UkmSource(); 23 ~UkmSource();
24 24
25 int32_t id() const { return id_; } 25 int32_t id() const { return id_; }
26 void set_id(int32_t id) { id_ = id; } 26 void set_id(int32_t id) { id_ = id; }
27 27
28 const GURL& committed_url() const { return committed_url_; } 28 const GURL& url() const { return url_; }
29 void set_committed_url(const GURL& committed_url) { 29 void set_url(const GURL& url) { url_ = url; }
30 committed_url_ = committed_url;
31 }
32
33 base::TimeDelta first_contentful_paint() const {
34 return first_contentful_paint_;
35 }
36 void set_first_contentful_paint(base::TimeDelta first_contentful_paint) {
37 first_contentful_paint_ = first_contentful_paint;
38 }
39 30
40 // Serializes the members of the class into the supplied proto. 31 // Serializes the members of the class into the supplied proto.
41 void PopulateProto(Source* proto_source); 32 void PopulateProto(Source* proto_source) const;
42 33
43 private: 34 private:
44 int32_t id_; 35 int32_t id_;
45 GURL committed_url_; 36 GURL url_;
46 base::TimeDelta first_contentful_paint_;
47 37
48 DISALLOW_COPY_AND_ASSIGN(UkmSource); 38 DISALLOW_COPY_AND_ASSIGN(UkmSource);
49 }; 39 };
50 40
51 } // namespace ukm 41 } // namespace ukm
52 42
53 #endif // COMPONENTS_UKM_UKM_SOURCE_H_ 43 #endif // COMPONENTS_UKM_UKM_SOURCE_H_
OLDNEW
« no previous file with comments | « components/ukm/ukm_service.cc ('k') | components/ukm/ukm_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698