Index: chrome/installer/util/experiment_storage.h |
diff --git a/chrome/installer/util/experiment_storage.h b/chrome/installer/util/experiment_storage.h |
index 40ed1d2ef170780d915b561e4b4f920212bf0cbd..f7f8c1d4e4e62d0800363ddce7ec71d53928289f 100644 |
--- a/chrome/installer/util/experiment_storage.h |
+++ b/chrome/installer/util/experiment_storage.h |
@@ -18,9 +18,9 @@ struct ExperimentMetrics; |
// Manages the storage of experiment state on the machine. |
// |
-// Participation is a per-install property evaluated one time to determine |
-// whether or not the install as a whole participates in the study. It is |
-// stored in the install's ClientState key. |
+// Participation is a per-install property evaluated one time to determine which |
+// study the client participates in. It is stored in the install's ClientState |
+// key. |
// |
// ExperimentMetrics are stored in a per-install experiment_label, while the |
// fine-grained Experiment data are stored in a per-user key in Chrome's |
@@ -38,16 +38,13 @@ struct ExperimentMetrics; |
// mutex is used for all reads and writes to ensure consistent state. |
class ExperimentStorage { |
public: |
- enum class Participation { |
- // No participation state was found for the install. |
- kNotEvaluated, |
+ // An identifier of which study the install participates in. |
+ using Study = uint32_t; |
- // The client is not participating in the study. |
- kNotParticipating, |
- |
- // The client is participating in the study. |
- kIsParticipating, |
- }; |
+ // The possible Study values. |
+ static constexpr Study kNoStudySelected = 0; |
+ static constexpr Study kStudyOne = 1; |
+ static constexpr Study kStudyTwo = 2; |
Nico
2017/06/15 14:47:37
nit: fwiw enum is kind of preferable over static c
grt (UTC plus 2)
2017/06/15 15:07:26
Hmm. Makes sense. I think I made the switch becaus
|
// Grants the holder exclusive access to the data in the registry. Consumers |
// are expected to not hold an instance across any blocking operations. |
@@ -56,12 +53,13 @@ class ExperimentStorage { |
~Lock(); |
// Reads the participation state for the install. Returns false in case of |
- // error. |
- bool ReadParticipation(Participation* participation); |
+ // error. |participation| is set to kNotEvaluated if no value is present; |
+ // otherwise, it is set to the value found. |
+ bool ReadParticipation(Study* participation); |
// Writes the participation state for the install. Returns false if the |
// write failed. |
- bool WriteParticipation(Participation participation); |
+ bool WriteParticipation(Study participation); |
// Loads the experiment metrics and data from the registry. Returns false if |
// the state in the registry corresponds to a different user or could not be |