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 #include "components/variations/processed_study.h" | 5 #include "components/variations/processed_study.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/version.h" | 10 #include "base/version.h" |
11 #include "components/variations/proto/study.pb.h" | 11 #include "components/variations/proto/study.pb.h" |
12 | 12 |
13 namespace chrome_variations { | 13 namespace variations { |
14 | 14 |
15 namespace { | 15 namespace { |
16 | 16 |
17 // Validates the sanity of |study| and computes the total probability. | 17 // Validates the sanity of |study| and computes the total probability. |
18 bool ValidateStudyAndComputeTotalProbability( | 18 bool ValidateStudyAndComputeTotalProbability( |
19 const Study& study, | 19 const Study& study, |
20 base::FieldTrial::Probability* total_probability) { | 20 base::FieldTrial::Probability* total_probability) { |
21 // At the moment, a missing default_experiment_name makes the study invalid. | 21 // At the moment, a missing default_experiment_name makes the study invalid. |
22 if (study.default_experiment_name().empty()) { | 22 if (study.default_experiment_name().empty()) { |
23 DVLOG(1) << study.name() << " has no default experiment defined."; | 23 DVLOG(1) << study.name() << " has no default experiment defined."; |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 bool is_expired, | 107 bool is_expired, |
108 std::vector<ProcessedStudy>* processed_studies) { | 108 std::vector<ProcessedStudy>* processed_studies) { |
109 ProcessedStudy processed_study; | 109 ProcessedStudy processed_study; |
110 if (processed_study.Init(study, is_expired)) { | 110 if (processed_study.Init(study, is_expired)) { |
111 processed_studies->push_back(processed_study); | 111 processed_studies->push_back(processed_study); |
112 return true; | 112 return true; |
113 } | 113 } |
114 return false; | 114 return false; |
115 } | 115 } |
116 | 116 |
117 } // namespace chrome_variations | 117 } // namespace variations |
OLD | NEW |