Index: components/variations/processed_study.cc |
diff --git a/components/variations/processed_study.cc b/components/variations/processed_study.cc |
index 9d0e4f14d512dbda40a6fda36a672a178e1257b0..88e572d654aad01fadc8d629934e3ea86fcf08dd 100644 |
--- a/components/variations/processed_study.cc |
+++ b/components/variations/processed_study.cc |
@@ -5,6 +5,7 @@ |
#include "components/variations/processed_study.h" |
#include <set> |
+#include <string> |
#include "base/version.h" |
#include "components/variations/proto/study.pb.h" |
@@ -91,6 +92,16 @@ bool ProcessedStudy::Init(const Study* study, bool is_expired) { |
return true; |
} |
+int ProcessedStudy::GetExperimentIndexByName( |
+ const std::string& name) const { |
+ for (int i = 0; i < study_->experiment_size(); ++i) { |
+ if (study_->experiment(i).name() == name) |
+ return i; |
+ } |
+ |
+ return -1; |
+} |
+ |
// static |
bool ProcessedStudy::ValidateAndAppendStudy( |
const Study* study, |