Chromium Code Reviews| Index: base/metrics/field_trial.h |
| diff --git a/base/metrics/field_trial.h b/base/metrics/field_trial.h |
| index 98361732994ddb8bc35368d420c5edc7d11acb7a..7bdd2dd1df8bae653a8cf5db1d4da6366f828471 100644 |
| --- a/base/metrics/field_trial.h |
| +++ b/base/metrics/field_trial.h |
| @@ -226,6 +226,8 @@ class BASE_EXPORT FieldTrial : public RefCounted<FieldTrial> { |
| friend class RefCounted<FieldTrial>; |
| + friend class FieldTrialParamAssociator; |
| + |
| // This is the group number of the 'default' group when a choice wasn't forced |
| // by a call to FieldTrialList::CreateFieldTrial. It is kept private so that |
| // consumers don't use it by mistake in cases where the group was forced. |
| @@ -433,6 +435,15 @@ class BASE_EXPORT FieldTrialList { |
| // metrics, crashes, etc. |
| static std::string FindFullName(const std::string& trial_name); |
| + // Looks in the allocator for |field_trial|'s params via its ref_, and stores |
| + // it in |params|. |
|
Alexei Svitkine (slow)
2016/11/23 17:23:39
This is talking about implementation detail.
Plea
lawrencewu
2016/11/23 19:07:33
Done.
|
| + static bool GetParamsFromSharedMemory( |
| + FieldTrial* field_trial, |
| + std::map<std::string, std::string>* params); |
| + |
| + // Clears all the params in the allocator. |
| + static void ClearParamsFromSharedMemoryForTesting(); |
| + |
| // Returns true if the named trial has been registered. |
| static bool TrialExists(const std::string& trial_name); |
| @@ -544,6 +555,7 @@ class BASE_EXPORT FieldTrialList { |
| // 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, AssociateFieldTrialParams); |
| #if defined(OS_WIN) |
| // Takes in |handle| that should have been retrieved from the command line and |
| @@ -597,7 +609,7 @@ class BASE_EXPORT FieldTrialList { |
| static bool used_without_global_; |
| // Lock for access to registered_. |
| - base::Lock lock_; |
| + Lock lock_; |
| RegistrationMap registered_; |
| std::map<std::string, std::string> seen_states_; |