Chromium Code Reviews| Index: base/metrics/field_trial_param_associator.h |
| diff --git a/base/metrics/field_trial_param_associator.h b/base/metrics/field_trial_param_associator.h |
| index 214e146966eebbdf8fe0888f4c705eea1f251fb0..b19c66661c7063035ab3058c6c8634dc2058afe1 100644 |
| --- a/base/metrics/field_trial_param_associator.h |
| +++ b/base/metrics/field_trial_param_associator.h |
| @@ -11,6 +11,7 @@ |
| #include "base/base_export.h" |
| #include "base/memory/singleton.h" |
| +#include "base/metrics/field_trial.h" |
| #include "base/synchronization/lock.h" |
| namespace base { |
| @@ -33,13 +34,26 @@ class BASE_EXPORT FieldTrialParamAssociator { |
| const std::string& group_name, |
| const FieldTrialParams& params); |
| - // Gets the parameters for a field trial and its chosen group. |
| + // Gets the parameters for a field trial and its chosen group. If not found in |
| + // field_trial_params_, then tries to looks it up in shared memory. |
| bool GetFieldTrialParams(const std::string& trial_name, |
| FieldTrialParams* params); |
| - // Clears the internal field_trial_params_ mapping. |
| + // Gets the parameters for a field trial and its chosen group. Does not |
| + // fallback to looking it up in shared memory. This should only be used if you |
| + // know for sure the params are in the mapping, like if you're in the browser |
| + // process, and even then you should probably just use GetFieldTrialParams(). |
|
bcwhite
2016/11/23 21:03:52
So... When _should_ this method be used?
lawrencewu
2016/11/23 21:49:20
Pretty much never, except for where it's currently
|
| + bool GetFieldTrialParamsWithoutFallback(const std::string& trial_name, |
| + const std::string& group_name, |
| + FieldTrialParams* params); |
| + |
| + // Clears the internal field_trial_params_ mapping, plus removes all params in |
| + // shared memory. |
| void ClearAllParamsForTesting(); |
| + // Clears the internal field_trial_params_ mapping. |
| + void ClearAllCachedParamsForTesting(); |
| + |
| private: |
| friend struct DefaultSingletonTraits<FieldTrialParamAssociator>; |