diff options
Diffstat (limited to 'components/variations/net/variations_http_header_provider.h')
-rw-r--r-- | components/variations/net/variations_http_header_provider.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/components/variations/net/variations_http_header_provider.h b/components/variations/net/variations_http_header_provider.h index a0e3046..0a511cc 100644 --- a/components/variations/net/variations_http_header_provider.h +++ b/components/variations/net/variations_http_header_provider.h @@ -7,11 +7,13 @@ #include <set> #include <string> +#include <vector> #include "base/basictypes.h" #include "base/gtest_prod_util.h" #include "base/metrics/field_trial.h" #include "base/synchronization/lock.h" +#include "components/metrics/metrics_service.h" #include "components/variations/variations_associated_data.h" namespace content { @@ -31,7 +33,8 @@ namespace variations { // A helper class for maintaining client experiments and metrics state // transmitted in custom HTTP request headers. // This class is a thread-safe singleton. -class VariationsHttpHeaderProvider : base::FieldTrialList::Observer { +class VariationsHttpHeaderProvider : public base::FieldTrialList::Observer, + public metrics::SyntheticTrialObserver { public: static VariationsHttpHeaderProvider* GetInstance(); @@ -66,12 +69,16 @@ class VariationsHttpHeaderProvider : base::FieldTrialList::Observer { VariationsHttpHeaderProvider(); ~VariationsHttpHeaderProvider() override; - // base::FieldTrialList::Observer implementation. + // base::FieldTrialList::Observer: // This will add the variation ID associated with |trial_name| and // |group_name| to the variation ID cache. void OnFieldTrialGroupFinalized(const std::string& trial_name, const std::string& group_name) override; + // metrics::SyntheticTrialObserver: + void OnSyntheticTrialsChanged( + const std::vector<metrics::SyntheticTrialGroup>& groups) override; + // Prepares the variation IDs cache with initial values if not already done. // This method also registers the caller with the FieldTrialList to receive // new variation IDs. @@ -102,6 +109,9 @@ class VariationsHttpHeaderProvider : base::FieldTrialList::Observer { std::set<VariationID> default_variation_ids_set_; std::set<VariationID> default_trigger_id_set_; + // Variations ids from synthetic field trials. + std::set<VariationID> synthetic_variation_ids_set_; + std::string variation_ids_header_; DISALLOW_COPY_AND_ASSIGN(VariationsHttpHeaderProvider); |