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

Unified Diff: components/variations/variations_associated_data.cc

Issue 2321273003: Extend VariationParamsManager to support feature associations. (Closed)
Patch Set: Last comments Created 4 years 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 ec1224524c4f6e2ab5308de24825dfbb2cdfcffd..465aed58c5407ddc22984d606120e338f0ca49e0 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/metrics/field_trial_param_associator.h"
#include "base/strings/string_split.h"
#include "components/variations/variations_http_header_provider.h"
@@ -19,8 +20,6 @@ namespace variations {
namespace {
-const char kGroupTesting[] = "Testing";
-
// The internal singleton accessor for the map, used to keep it thread-safe.
class GroupMapAccessor {
public:
@@ -195,26 +194,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();
}
« no previous file with comments | « components/variations/variations_associated_data.h ('k') | components/variations/variations_params_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698