| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_VARIATIONS_PROCESSED_STUDY_H_ | 5 #ifndef COMPONENTS_VARIATIONS_PROCESSED_STUDY_H_ |
| 6 #define COMPONENTS_VARIATIONS_PROCESSED_STUDY_H_ | 6 #define COMPONENTS_VARIATIONS_PROCESSED_STUDY_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 ~ProcessedStudy(); | 22 ~ProcessedStudy(); |
| 23 | 23 |
| 24 bool Init(const Study* study, bool is_expired); | 24 bool Init(const Study* study, bool is_expired); |
| 25 | 25 |
| 26 const Study* study() const { return study_; } | 26 const Study* study() const { return study_; } |
| 27 | 27 |
| 28 base::FieldTrial::Probability total_probability() const { | 28 base::FieldTrial::Probability total_probability() const { |
| 29 return total_probability_; | 29 return total_probability_; |
| 30 } | 30 } |
| 31 | 31 |
| 32 bool all_assignments_to_one_group() const { |
| 33 return all_assignments_to_one_group_; |
| 34 } |
| 35 |
| 32 bool is_expired() const { return is_expired_; } | 36 bool is_expired() const { return is_expired_; } |
| 33 | 37 |
| 34 // Gets the index of the experiment with the given |name|. Returns -1 if no | 38 // Gets the index of the experiment with the given |name|. Returns -1 if no |
| 35 // experiment is found. | 39 // experiment is found. |
| 36 int GetExperimentIndexByName(const std::string& name) const; | 40 int GetExperimentIndexByName(const std::string& name) const; |
| 37 | 41 |
| 38 static bool ValidateAndAppendStudy( | 42 static bool ValidateAndAppendStudy( |
| 39 const Study* study, | 43 const Study* study, |
| 40 bool is_expired, | 44 bool is_expired, |
| 41 std::vector<ProcessedStudy>* processed_studies); | 45 std::vector<ProcessedStudy>* processed_studies); |
| 42 | 46 |
| 43 private: | 47 private: |
| 44 // Corresponding Study object. Weak reference. | 48 // Corresponding Study object. Weak reference. |
| 45 const Study* study_; | 49 const Study* study_; |
| 46 | 50 |
| 47 // Computed total group probability for the study. | 51 // Computed total group probability for the study. |
| 48 base::FieldTrial::Probability total_probability_; | 52 base::FieldTrial::Probability total_probability_; |
| 49 | 53 |
| 54 // Whether all assignments are to a single group. |
| 55 bool all_assignments_to_one_group_; |
| 56 |
| 50 // Whether the study is expired. | 57 // Whether the study is expired. |
| 51 bool is_expired_; | 58 bool is_expired_; |
| 52 }; | 59 }; |
| 53 | 60 |
| 54 } // namespace variations | 61 } // namespace variations |
| 55 | 62 |
| 56 #endif // COMPONENTS_VARIATIONS_PROCESSED_STUDY_H_ | 63 #endif // COMPONENTS_VARIATIONS_PROCESSED_STUDY_H_ |
| OLD | NEW |