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
3 // found in the LICENSE file.
5 #ifndef COMPONENTS_VARIATIONS_PROCESSED_STUDY_H_
6 #define COMPONENTS_VARIATIONS_PROCESSED_STUDY_H_
10 #include "base/metrics/field_trial.h"
12 namespace chrome_variations
{
16 // Wrapper over Study with extra information computed during pre-processing,
17 // such as whether the study is expired and its total probability.
18 class ProcessedStudy
{
23 bool Init(const Study
* study
, bool is_expired
);
25 const Study
* study() const { return study_
; }
27 base::FieldTrial::Probability
total_probability() const {
28 return total_probability_
;
31 bool is_expired() const { return is_expired_
; }
33 static bool ValidateAndAppendStudy(
36 std::vector
<ProcessedStudy
>* processed_studies
);
39 // Corresponding Study object. Weak reference.
42 // Computed total group probability for the study.
43 base::FieldTrial::Probability total_probability_
;
45 // Whether the study is expired.
49 } // namespace chrome_variations
51 #endif // COMPONENTS_VARIATIONS_PROCESSED_STUDY_H_