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

Unified Diff: base/metrics/field_trial.h

Issue 153913009: Make some field trials unforceable via command-line in the official build. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nit Created 6 years, 10 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 | « no previous file | base/metrics/field_trial.cc » ('j') | chrome/browser/chrome_browser_main.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/metrics/field_trial.h
diff --git a/base/metrics/field_trial.h b/base/metrics/field_trial.h
index 5a4375ee65ed1510b00b7062b0adae735ab3d794..6df4ee85589f90d1ae4271cc8453bebda345ea64 100644
--- a/base/metrics/field_trial.h
+++ b/base/metrics/field_trial.h
@@ -59,6 +59,7 @@
#include <vector>
#include "base/base_export.h"
+#include "base/callback_forward.h"
#include "base/gtest_prod_util.h"
#include "base/memory/ref_counted.h"
#include "base/observer_list_threadsafe.h"
@@ -289,6 +290,11 @@ class BASE_EXPORT FieldTrial : public RefCounted<FieldTrial> {
// Only one instance of this class exists.
class BASE_EXPORT FieldTrialList {
public:
+ // A callback that returns true if |name| describes a field trial that should
+ // be accepted by the method it was passed to.
+ typedef base::Callback<bool(const std::string& name)>
Alexei Svitkine (slow) 2014/02/12 14:26:47 Nit: |name| -> |trial_name| to be consistent with
gab 2014/02/12 15:59:19 Done.
+ IsAcceptedFieldTrialCallback;
+
// Specifies whether field trials should be activated (marked as "used"), when
// created using |CreateTrialsFromString()|.
enum FieldTrialActivationMode {
@@ -412,9 +418,12 @@ class BASE_EXPORT FieldTrialList {
// browser process into this non-browser process, but could also be invoked
// through a command line argument to the browser process. The created field
// trials are marked as "used" for the purposes of active trial reporting if
- // |mode| is ACTIVATE_TRIALS.
- static bool CreateTrialsFromString(const std::string& prior_trials,
- FieldTrialActivationMode mode);
+ // |mode| is ACTIVATE_TRIALS. If |is_accepted_callback| is not null: field
+ // trials for which |is_accepted_callback| returns false are ignored.
+ static bool CreateTrialsFromString(
+ const std::string& prior_trials,
+ FieldTrialActivationMode mode,
+ const IsAcceptedFieldTrialCallback& is_accepted_callback);
// Create a FieldTrial with the given |name| and using 100% probability for
// the FieldTrial, force FieldTrial to have the same group string as
« no previous file with comments | « no previous file | base/metrics/field_trial.cc » ('j') | chrome/browser/chrome_browser_main.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698