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

Unified Diff: components/variations/variations_associated_data.cc

Issue 2321273003: Extend VariationParamsManager to support feature associations. (Closed)
Patch Set: Alexei's comments Created 4 years, 3 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
Index: components/variations/variations_associated_data.cc
diff --git a/components/variations/variations_associated_data.cc b/components/variations/variations_associated_data.cc
index d257d01999f0619e18ee76ff39a294e4b166bd1a..fc07d9f26a8115d1c68186b633d65f2094e77514 100644
--- a/components/variations/variations_associated_data.cc
+++ b/components/variations/variations_associated_data.cc
@@ -11,6 +11,7 @@
#include "base/feature_list.h"
#include "base/macros.h"
#include "base/memory/singleton.h"
+#include "base/metrics/field_trial.h"
#include "base/strings/string_split.h"
#include "components/variations/variations_http_header_provider.h"
@@ -18,8 +19,6 @@ namespace variations {
namespace {
-const char kGroupTesting[] = "Testing";
-
// The internal singleton accessor for the map, used to keep it thread-safe.
class GroupMapAccessor {
public:
@@ -256,26 +255,6 @@ std::string GetVariationParamValueByFeature(const base::Feature& feature,
// They simply wrap existing functions in this file.
namespace testing {
-VariationParamsManager::VariationParamsManager(
- const std::string& trial_name,
- const std::map<std::string, std::string>& params) {
- SetVariationParams(trial_name, params);
-}
-
-VariationParamsManager::~VariationParamsManager() {
- ClearAllVariationIDs();
- ClearAllVariationParams();
- field_trial_list_.reset();
-}
-
-void VariationParamsManager::SetVariationParams(
- const std::string& trial_name,
- const std::map<std::string, std::string>& params) {
- field_trial_list_.reset(new base::FieldTrialList(nullptr));
- variations::AssociateVariationParams(trial_name, kGroupTesting, params);
- base::FieldTrialList::CreateFieldTrial(trial_name, kGroupTesting);
-}
-
void ClearAllVariationIDs() {
GroupMapAccessor::GetInstance()->ClearAllMapsForTesting();
}

Powered by Google App Engine
This is Rietveld 408576698