| OLD | NEW |
| 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 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 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) const; | 29 void PopulateProto(Entry* proto_entry) const; |
| 30 | 30 |
| 31 int32_t source_id() const { return source_id_; } | 31 int32_t source_id() const { return source_id_; } |
| 32 uint64_t event_hash() const { return event_hash_; } |
| 32 | 33 |
| 33 ~UkmEntry(); | 34 ~UkmEntry(); |
| 34 | 35 |
| 35 private: | 36 private: |
| 36 friend UkmEntryBuilder; | 37 friend UkmEntryBuilder; |
| 37 | 38 |
| 38 UkmEntry(int32_t source_id, const char* event_name); | 39 UkmEntry(int32_t source_id, const char* event_name); |
| 39 | 40 |
| 40 const int32_t source_id_; | 41 const int32_t source_id_; |
| 41 const uint64_t event_hash_; | 42 const uint64_t event_hash_; |
| 42 std::vector<std::pair<uint64_t, int64_t>> metrics_; | 43 std::vector<std::pair<uint64_t, int64_t>> metrics_; |
| 43 | 44 |
| 44 DISALLOW_COPY_AND_ASSIGN(UkmEntry); | 45 DISALLOW_COPY_AND_ASSIGN(UkmEntry); |
| 45 }; | 46 }; |
| 46 | 47 |
| 47 } // namespace ukm | 48 } // namespace ukm |
| 48 | 49 |
| 49 #endif // COMPONENTS_UKM_UKM_ENTRY_H_ | 50 #endif // COMPONENTS_UKM_UKM_ENTRY_H_ |
| OLD | NEW |