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

Side by Side Diff: components/ukm/ukm_entry.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/test_ukm_service.cc ('k') | components/ukm/ukm_entry.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_ENTRY_H_ 5 #ifndef COMPONENTS_UKM_UKM_ENTRY_H_
6 #define COMPONENTS_UKM_UKM_ENTRY_H_ 6 #define COMPONENTS_UKM_UKM_ENTRY_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/macros.h" 11 #include "base/macros.h"
12 12
13 namespace ukm { 13 namespace ukm {
14 14
15 class Entry; 15 class Entry;
16 class UkmEntryBuilder; 16 class UkmEntryBuilder;
17 17
18 // One UkmEntry contains metrics for a specific source and event. It is 18 // One UkmEntry contains metrics for a specific source and event. It is
19 // connected to a UkmSource by the source ID. The event can be user defined. 19 // connected to a UkmSource by the source ID. The event can be user defined.
20 // One example is "PageLoad". Each UkmEntry can have a list of metrics, each of 20 // One example is "PageLoad". Each UkmEntry can have a list of metrics, each of
21 // which consist of a metric name and value. When the entry is serialized to the 21 // which consist of a metric name and value. When the entry is serialized to the
22 // proto message, the event and metric names will be hashed by 22 // proto message, the event and metric names will be hashed by
23 // base::HashMetricName. 23 // base::HashMetricName.
24 // 24 //
25 // To build UkmEntry objects, please use UkmEntryBuilder. 25 // To build UkmEntry objects, please use UkmEntryBuilder.
26 class UkmEntry { 26 class UkmEntry {
27 public: 27 public:
28 // Serializes the members of the class into the supplied proto. 28 // Serializes the members of the class into the supplied proto.
29 void PopulateProto(Entry* proto_entry); 29 void PopulateProto(Entry* proto_entry) const;
30
31 int32_t source_id() const { return source_id_; }
30 32
31 ~UkmEntry(); 33 ~UkmEntry();
32 34
33 private: 35 private:
34 friend UkmEntryBuilder; 36 friend UkmEntryBuilder;
35 37
36 UkmEntry(int32_t source_id, const char* event_name); 38 UkmEntry(int32_t source_id, const char* event_name);
37 39
38 const int32_t source_id_; 40 const int32_t source_id_;
39 const uint64_t event_hash_; 41 const uint64_t event_hash_;
40 std::vector<std::pair<uint64_t, int64_t>> metrics_; 42 std::vector<std::pair<uint64_t, int64_t>> metrics_;
41 43
42 DISALLOW_COPY_AND_ASSIGN(UkmEntry); 44 DISALLOW_COPY_AND_ASSIGN(UkmEntry);
43 }; 45 };
44 46
45 } // namespace ukm 47 } // namespace ukm
46 48
47 #endif // COMPONENTS_UKM_UKM_ENTRY_H_ 49 #endif // COMPONENTS_UKM_UKM_ENTRY_H_
OLDNEW
« no previous file with comments | « components/ukm/test_ukm_service.cc ('k') | components/ukm/ukm_entry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698