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

Unified Diff: base/metrics/field_trial_param_associator.h

Issue 2463223002: Store field trial parameters in shared memory (Closed)
Patch Set: check that cache has been cleared in test Created 4 years 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 | « base/metrics/field_trial.cc ('k') | base/metrics/field_trial_param_associator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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().
+ 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>;
« no previous file with comments | « base/metrics/field_trial.cc ('k') | base/metrics/field_trial_param_associator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698