| 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 <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/metrics/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 bool Init(const Study* study, bool is_expired); | 23 bool Init(const Study* study, bool is_expired); |
| 24 | 24 |
| 25 const Study* study() const { return study_; } | 25 const Study* study() const { return study_; } |
| 26 | 26 |
| 27 base::FieldTrial::Probability total_probability() const { | 27 base::FieldTrial::Probability total_probability() const { |
| 28 return total_probability_; | 28 return total_probability_; |
| 29 } | 29 } |
| 30 | 30 |
| 31 bool is_expired() const { return is_expired_; } | 31 bool is_expired() const { return is_expired_; } |
| 32 | 32 |
| 33 // Gets the index of the experiment with the given |name|. Returns -1 if no |
| 34 // experiment is found. |
| 35 int GetExperimentIndexByName(const std::string& name) const; |
| 36 |
| 33 static bool ValidateAndAppendStudy( | 37 static bool ValidateAndAppendStudy( |
| 34 const Study* study, | 38 const Study* study, |
| 35 bool is_expired, | 39 bool is_expired, |
| 36 std::vector<ProcessedStudy>* processed_studies); | 40 std::vector<ProcessedStudy>* processed_studies); |
| 37 | 41 |
| 38 private: | 42 private: |
| 39 // Corresponding Study object. Weak reference. | 43 // Corresponding Study object. Weak reference. |
| 40 const Study* study_; | 44 const Study* study_; |
| 41 | 45 |
| 42 // Computed total group probability for the study. | 46 // Computed total group probability for the study. |
| 43 base::FieldTrial::Probability total_probability_; | 47 base::FieldTrial::Probability total_probability_; |
| 44 | 48 |
| 45 // Whether the study is expired. | 49 // Whether the study is expired. |
| 46 bool is_expired_; | 50 bool is_expired_; |
| 47 }; | 51 }; |
| 48 | 52 |
| 49 } // namespace chrome_variations | 53 } // namespace chrome_variations |
| 50 | 54 |
| 51 #endif // COMPONENTS_VARIATIONS_PROCESSED_STUDY_H_ | 55 #endif // COMPONENTS_VARIATIONS_PROCESSED_STUDY_H_ |
| OLD | NEW |