Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(61)

Unified Diff: components/variations/processed_study.cc

Issue 2615763002: Revert of Supporting study definitions without default groups and end_date filtering. (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/variations/processed_study.h ('k') | components/variations/proto/study.proto » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/variations/processed_study.cc
diff --git a/components/variations/processed_study.cc b/components/variations/processed_study.cc
index 10a1bd78ed409dd404179f2365c869d2c0ae877b..8c1f8d0f8a1cd6852cd2fb234dbec9267b4f8710 100644
--- a/components/variations/processed_study.cc
+++ b/components/variations/processed_study.cc
@@ -21,6 +21,11 @@
base::FieldTrial::Probability* total_probability,
bool* all_assignments_to_one_group,
std::string* single_feature_name) {
+ // At the moment, a missing default_experiment_name makes the study invalid.
+ if (study.default_experiment_name().empty()) {
+ DVLOG(1) << study.name() << " has no default experiment defined.";
+ return false;
+ }
if (study.filter().has_min_version() &&
!base::Version::IsValidWildcardString(study.filter().min_version())) {
DVLOG(1) << study.name() << " has invalid min version: "
@@ -87,11 +92,9 @@
found_default_group = true;
}
- // Specifying a default experiment is optional, so finding it in the
- // experiment list is only required when it is specified.
- if (!study.default_experiment_name().empty() && !found_default_group) {
- DVLOG(1) << study.name() << " is missing default experiment ("
- << study.default_experiment_name() << ") in its experiment list";
+ if (!found_default_group) {
+ DVLOG(1) << study.name() << " is missing default experiment in its "
+ << "experiment list";
// The default group was not found in the list of groups. This study is not
// valid.
return false;
@@ -109,10 +112,6 @@
} // namespace
-
-// static
-const std::string ProcessedStudy::kGenericDefaultExperimentName =
- "VariationsDefaultExperiment";
ProcessedStudy::ProcessedStudy()
: study_(NULL),
@@ -151,13 +150,6 @@
return -1;
}
-const std::string& ProcessedStudy::GetDefaultExperimentName() const {
- if (study_->default_experiment_name().empty())
- return kGenericDefaultExperimentName;
-
- return study_->default_experiment_name();
-}
-
// static
bool ProcessedStudy::ValidateAndAppendStudy(
const Study* study,
« no previous file with comments | « components/variations/processed_study.h ('k') | components/variations/proto/study.proto » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698