Commit 9ae0cdee authored by Kyle Milka's avatar Kyle Milka Committed by Commit Bot

Add the PlatformFieldTrials Class

This is part 4 of 6 for FieldTrial refactoring for WebView

Part 1: https://chromium-review.googlesource.com/c/562098/
Part 2: https://chromium-review.googlesource.com/c/561920/
Part 3: https://chromium-review.googlesource.com/c/561922/
Part 4: https://chromium-review.googlesource.com/c/561980/
Part 5: https://chromium-review.googlesource.com/c/562417/
Part 6: https://chromium-review.googlesource.com/c/562021/

This CL adds a new class, PlatformFieldTrials, that the 
Chrome specific ChromeBrowserFieldTrials is now
derived from. Its implementation is currently just stubs
as they shouldn't be necessary for WebView.

BUG=678288

Change-Id: I5d7b1b77f5af39594977a5bd7ed66bf51cb63628
Reviewed-on: https://chromium-review.googlesource.com/561980
Commit-Queue: Kyle Milka <kmilka@google.com>
Reviewed-by: default avatarAlexei Svitkine (slow) <asvitkine@chromium.org>
Cr-Commit-Position: refs/heads/master@{#488383}
parent 4573bf14
...@@ -6,26 +6,22 @@ ...@@ -6,26 +6,22 @@
#define CHROME_BROWSER_CHROME_BROWSER_FIELD_TRIALS_H_ #define CHROME_BROWSER_CHROME_BROWSER_FIELD_TRIALS_H_
#include "base/macros.h" #include "base/macros.h"
#include "components/variations/platform_field_trials.h"
namespace base { namespace base {
class FeatureList; class FeatureList;
} }
class ChromeBrowserFieldTrials { class ChromeBrowserFieldTrials : public variations::PlatformFieldTrials {
public: public:
ChromeBrowserFieldTrials(); ChromeBrowserFieldTrials();
~ChromeBrowserFieldTrials(); ~ChromeBrowserFieldTrials() override;
void SetupFieldTrials(); // variations::PlatformFieldTrials:
void SetupFieldTrials() override;
// Create field trials that will control feature list features. This should be void SetupFeatureControllingFieldTrials(
// called during the same timing window as bool has_seed,
// FeatureList::AssociateReportingFieldTrial. |has_seed| indicates that the base::FeatureList* feature_list) override;
// variations service used a seed to create field trials. This can be used to
// prevent associating a field trial with a feature that you expect to be
// controlled by the variations seed.
void SetupFeatureControllingFieldTrials(bool has_seed,
base::FeatureList* feature_list);
private: private:
// Instantiates dynamic trials by querying their state, to ensure they get // Instantiates dynamic trials by querying their state, to ensure they get
......
...@@ -30,6 +30,7 @@ static_library("variations") { ...@@ -30,6 +30,7 @@ static_library("variations") {
"metrics.h", "metrics.h",
"metrics_util.cc", "metrics_util.cc",
"metrics_util.h", "metrics_util.h",
"platform_field_trials.h",
"pref_names.cc", "pref_names.cc",
"pref_names.h", "pref_names.h",
"processed_study.cc", "processed_study.cc",
......
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef COMPONENTS_VARIATIONS_PLATFORM_FIELD_TRIALS_H_
#define COMPONENTS_VARIATIONS_PLATFORM_FIELD_TRIALS_H_
#include "base/metrics/field_trial.h"
namespace variations {
// Infrastructure for setting up platform specific field trials. Chrome and
// WebView make use through their corresponding subclasses.
class PlatformFieldTrials {
public:
PlatformFieldTrials(){};
virtual ~PlatformFieldTrials(){};
// Set up field trials for a specific platform.
virtual void SetupFieldTrials() = 0;
// Create field trials that will control feature list features. This should be
// called during the same timing window as
// FeatureList::AssociateReportingFieldTrial. |has_seed| indicates that the
// variations service used a seed to create field trials. This can be used to
// prevent associating a field trial with a feature that you expect to be
// controlled by the variations seed.
virtual void SetupFeatureControllingFieldTrials(
bool has_seed,
base::FeatureList* feature_list) = 0;
private:
DISALLOW_COPY_AND_ASSIGN(PlatformFieldTrials);
};
} // namespace variations
#endif // COMPONENTS_VARIATIONS_PLATFORM_FIELD_TRIALS_H_
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment