| Index: base/metrics/field_trial.h
|
| diff --git a/base/metrics/field_trial.h b/base/metrics/field_trial.h
|
| index 34b9782bee0fe06c51abf1383c3d98c247c4a958..b57a38511cc06750bd470c4a7c030ef29b56c8fd 100644
|
| --- a/base/metrics/field_trial.h
|
| +++ b/base/metrics/field_trial.h
|
| @@ -223,6 +223,7 @@ class BASE_EXPORT FieldTrial : public RefCounted<FieldTrial> {
|
| FRIEND_TEST_ALL_PREFIXES(FieldTrialTest, DoesNotSurpassTotalProbability);
|
| FRIEND_TEST_ALL_PREFIXES(FieldTrialListTest,
|
| DoNotAddSimulatedFieldTrialsToAllocator);
|
| + FRIEND_TEST_ALL_PREFIXES(FieldTrialListTest, ClearParamsFromSharedMemory);
|
|
|
| friend class base::FieldTrialList;
|
|
|
| @@ -550,12 +551,24 @@ class BASE_EXPORT FieldTrialList {
|
| // Return the number of active field trials.
|
| static size_t GetFieldTrialCount();
|
|
|
| + // Gets the parameters for |field_trial| from shared memory and stores them in
|
| + // |params|. This is only exposed for use by FieldTrialParamAssociator and
|
| + // shouldn't be used by anything else.
|
| + static bool GetParamsFromSharedMemory(
|
| + FieldTrial* field_trial,
|
| + std::map<std::string, std::string>* params);
|
| +
|
| + // Clears all the params in the allocator.
|
| + static void ClearParamsFromSharedMemoryForTesting();
|
| +
|
| private:
|
| // Allow tests to access our innards for testing purposes.
|
| FRIEND_TEST_ALL_PREFIXES(FieldTrialListTest, InstantiateAllocator);
|
| FRIEND_TEST_ALL_PREFIXES(FieldTrialListTest, AddTrialsToAllocator);
|
| FRIEND_TEST_ALL_PREFIXES(FieldTrialListTest,
|
| DoNotAddSimulatedFieldTrialsToAllocator);
|
| + FRIEND_TEST_ALL_PREFIXES(FieldTrialListTest, AssociateFieldTrialParams);
|
| + FRIEND_TEST_ALL_PREFIXES(FieldTrialListTest, ClearParamsFromSharedMemory);
|
|
|
| #if defined(OS_WIN)
|
| // Takes in |handle| that should have been retrieved from the command line and
|
| @@ -608,8 +621,8 @@ class BASE_EXPORT FieldTrialList {
|
| // FieldTrialList is created after that.
|
| static bool used_without_global_;
|
|
|
| - // Lock for access to registered_.
|
| - base::Lock lock_;
|
| + // Lock for access to registered_ and field_trial_allocator_.
|
| + Lock lock_;
|
| RegistrationMap registered_;
|
|
|
| std::map<std::string, std::string> seen_states_;
|
|
|