| 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..eba49abf56c6bdd7528d9842a4916f5d663dc738 100644
|
| --- a/base/metrics/field_trial_param_associator.h
|
| +++ b/base/metrics/field_trial_param_associator.h
|
| @@ -33,10 +33,20 @@ 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. If the parameters are not in the
|
| + // mapping, then check the field trial entry in shared memory for the
|
| + // parameters and cache them here. This version of the API doesn't activate
|
| + // the trial, which is what we want, since serializing to child processes
|
| + // shouldn't activate the trial.
|
| bool GetFieldTrialParams(const std::string& trial_name,
|
| FieldTrialParams* params);
|
|
|
| + // Same as above, except doesn't search in FieldTrialList for the group name,
|
| + // since that can cause a deadlock if calling from FieldTrialList.
|
| + bool GetFieldTrialParamsWithGroupName(const std::string& trial_name,
|
| + const std::string& group_name,
|
| + FieldTrialParams* params);
|
| +
|
| // Clears the internal field_trial_params_ mapping.
|
| void ClearAllParamsForTesting();
|
|
|
| @@ -46,6 +56,17 @@ class BASE_EXPORT FieldTrialParamAssociator {
|
| // (field_trial_name, field_trial_group)
|
| typedef std::pair<std::string, std::string> FieldTrialKey;
|
|
|
| + // Looks up the field trial entry in shared memory and gets the params from
|
| + // there.
|
| + bool GetParamsFromSharedMemory(const std::string& trial_name,
|
| + const std::string& group_name,
|
| + FieldTrialParams* params);
|
| +
|
| + // Sets the parameters for |trial_name| and |group_name|. Caller must lock.
|
| + bool AssociateParamsWhileLocked(const std::string& trial_name,
|
| + const std::string& group_name,
|
| + const FieldTrialParams& params);
|
| +
|
| Lock lock_;
|
| std::map<FieldTrialKey, FieldTrialParams> field_trial_params_;
|
|
|
|
|