Store synthetic trial and group names in memory

Part 1/2

Context: when creating the UKM report (proto), we append "UKM"
to the trial and group names, before hashing and them and writing them
to the report. This is not currently done for synthetic trials, because
we currently only store the hashes of the trial and group name (for
efficiency reasons -- instead of re-calculating the hashes every time).

This CL:

1. Adds `trial_name` and `group_name` fields to `SyntheticTrialGroup`

2. Change `SyntheticTrialGroup` from a struct to a class. Reasoning:
since it now stores the trial (or group) name along with its hash, in
order to maintain consistency between them, we change the struct to a
class and expose mutators that will maintain consistency.

3. Remove `RegisterSyntheticFieldTrialWithNameAndGroupHash`, a function
to register a synthetic trial given a trial name hash and a group name
hash. It is unused, and allowing a user to register a trial would not
allow us to know the actual trial and group names.

A follow up CL will actually append "UKM" to the trial and group names.

Bug: 1320847,b/227744487
Change-Id: I18a0ea7974e2f8314d0bf876e8820e3eadd466aa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3615130
Reviewed-by: Robert Kaplow <rkaplow@chromium.org>
Commit-Queue: Luc Nguyen <lucnguyen@google.com>
Cr-Commit-Position: refs/heads/main@{#999581}
NOKEYCHECK=True
GitOrigin-RevId: 75a8bb2ee0d4f926b80d194662a8c37af5934835
3 files changed
tree: ab271329c4923d2f3ecb545a5621f3e41d49593a
  1. android/
  2. content/
  3. demographics/
  4. library_support/
  5. net/
  6. public/
  7. serialization/
  8. structured/
  9. system_session_analyzer/
  10. test/
  11. ui/
  12. android_metrics_provider.cc
  13. android_metrics_provider.h
  14. android_metrics_provider_unittest.cc
  15. BUILD.gn
  16. call_stack_profile_builder.cc
  17. call_stack_profile_builder.h
  18. call_stack_profile_builder_unittest.cc
  19. call_stack_profile_collector.cc
  20. call_stack_profile_collector.h
  21. call_stack_profile_encoding.cc
  22. call_stack_profile_encoding.h
  23. call_stack_profile_metadata.cc
  24. call_stack_profile_metadata.h
  25. call_stack_profile_metadata_unittest.cc
  26. call_stack_profile_metrics_provider.cc
  27. call_stack_profile_metrics_provider.h
  28. call_stack_profile_metrics_provider_unittest.cc
  29. call_stack_profile_params.h
  30. child_call_stack_profile_collector.cc
  31. child_call_stack_profile_collector.h
  32. child_call_stack_profile_collector_unittest.cc
  33. clean_exit_beacon.cc
  34. clean_exit_beacon.h
  35. clean_exit_beacon_ios.mm
  36. clean_exit_beacon_unittest.cc
  37. client_info.cc
  38. client_info.h
  39. cloned_install_detector.cc
  40. cloned_install_detector.h
  41. cloned_install_detector_unittest.cc
  42. component_metrics_provider.cc
  43. component_metrics_provider.h
  44. component_metrics_provider_unittest.cc
  45. cpu_metrics_provider.cc
  46. cpu_metrics_provider.h
  47. daily_event.cc
  48. daily_event.h
  49. daily_event_unittest.cc
  50. data_use_tracker.cc
  51. data_use_tracker.h
  52. data_use_tracker_unittest.cc
  53. date_changed_helper.cc
  54. date_changed_helper.h
  55. date_changed_helper_unittest.cc
  56. delegating_provider.cc
  57. delegating_provider.h
  58. DEPS
  59. DIR_METADATA
  60. drive_metrics_provider.cc
  61. drive_metrics_provider.h
  62. drive_metrics_provider_android.cc
  63. drive_metrics_provider_fuchsia.cc
  64. drive_metrics_provider_ios.mm
  65. drive_metrics_provider_linux.cc
  66. drive_metrics_provider_mac.mm
  67. drive_metrics_provider_unittest.cc
  68. drive_metrics_provider_win.cc
  69. enabled_state_provider.cc
  70. enabled_state_provider.h
  71. entropy_state.cc
  72. entropy_state.h
  73. entropy_state_provider.cc
  74. entropy_state_provider.h
  75. entropy_state_provider_unittest.cc
  76. entropy_state_unittest.cc
  77. environment_recorder.cc
  78. environment_recorder.h
  79. environment_recorder_unittest.cc
  80. expired_histogram_util.cc
  81. expired_histogram_util.h
  82. expired_histograms_checker.cc
  83. expired_histograms_checker.h
  84. expired_histograms_checker_unittest.cc
  85. field_trials_provider.cc
  86. field_trials_provider.h
  87. field_trials_provider_unittest.cc
  88. file_metrics_provider.cc
  89. file_metrics_provider.h
  90. file_metrics_provider_unittest.cc
  91. form_factor_metrics_provider.cc
  92. form_factor_metrics_provider.h
  93. form_factor_metrics_provider_unittest.cc
  94. generate_expired_histograms_array.gni
  95. histogram_encoder.cc
  96. histogram_encoder.h
  97. histogram_encoder_unittest.cc
  98. log_decoder.cc
  99. log_decoder.h
  100. log_decoder_unittest.cc
  101. log_store.h
  102. machine_id_provider.h
  103. machine_id_provider_nonwin.cc
  104. machine_id_provider_nonwin_unittest.cc
  105. machine_id_provider_win.cc
  106. machine_id_provider_win_unittest.cc
  107. metrics_data_validation.cc
  108. metrics_data_validation.h
  109. metrics_data_validation_unittest.cc
  110. metrics_log.cc
  111. metrics_log.h
  112. metrics_log_manager.cc
  113. metrics_log_manager.h
  114. metrics_log_manager_unittest.cc
  115. metrics_log_store.cc
  116. metrics_log_store.h
  117. metrics_log_store_unittest.cc
  118. metrics_log_unittest.cc
  119. metrics_log_uploader.h
  120. metrics_pref_names.cc
  121. metrics_pref_names.h
  122. metrics_provider.cc
  123. metrics_provider.h
  124. metrics_reporting_default_state.cc
  125. metrics_reporting_default_state.h
  126. metrics_reporting_service.cc
  127. metrics_reporting_service.h
  128. metrics_rotation_scheduler.cc
  129. metrics_rotation_scheduler.h
  130. metrics_scheduler.cc
  131. metrics_scheduler.h
  132. metrics_service.cc
  133. metrics_service.h
  134. metrics_service_accessor.cc
  135. metrics_service_accessor.h
  136. metrics_service_client.cc
  137. metrics_service_client.h
  138. metrics_service_client_unittest.cc
  139. metrics_service_unittest.cc
  140. metrics_state_manager.cc
  141. metrics_state_manager.h
  142. metrics_state_manager_unittest.cc
  143. metrics_switches.cc
  144. metrics_switches.h
  145. metrics_upload_scheduler.cc
  146. metrics_upload_scheduler.h
  147. OWNERS
  148. persistent_histograms.cc
  149. persistent_histograms.h
  150. persistent_system_profile.cc
  151. persistent_system_profile.h
  152. persistent_system_profile_unittest.cc
  153. psi_memory_parser.h
  154. psi_memory_parser_linux.cc
  155. psi_memory_parser_linux_unittest.cc
  156. README
  157. reporting_service.cc
  158. reporting_service.h
  159. reporting_service_unittest.cc
  160. sampling_metrics_provider.cc
  161. sampling_metrics_provider.h
  162. single_sample_metrics.cc
  163. single_sample_metrics.h
  164. single_sample_metrics_factory_impl.cc
  165. single_sample_metrics_factory_impl.h
  166. single_sample_metrics_factory_impl_unittest.cc
  167. stability_metrics_helper.cc
  168. stability_metrics_helper.h
  169. stability_metrics_helper_unittest.cc
  170. stability_metrics_provider.cc
  171. stability_metrics_provider.h
  172. stability_metrics_provider_unittest.cc
  173. system_memory_stats_recorder.h
  174. system_memory_stats_recorder_linux.cc
  175. ukm_demographic_metrics_provider.h
  176. unsent_log_store.cc
  177. unsent_log_store.h
  178. unsent_log_store_metrics.cc
  179. unsent_log_store_metrics.h
  180. unsent_log_store_metrics_impl.cc
  181. unsent_log_store_metrics_impl.h
  182. unsent_log_store_metrics_impl_unittest.cc
  183. unsent_log_store_unittest.cc
  184. url_constants.cc
  185. url_constants.h
  186. version_utils.cc
  187. version_utils.h