| Index: chrome/browser/metrics/variations/variations_service.h
|
| ===================================================================
|
| --- chrome/browser/metrics/variations/variations_service.h (revision 269404)
|
| +++ chrome/browser/metrics/variations/variations_service.h (working copy)
|
| @@ -30,6 +30,10 @@
|
| class PrefRegistrySyncable;
|
| }
|
|
|
| +namespace metrics {
|
| +class MetricsStateManager;
|
| +}
|
| +
|
| namespace chrome_variations {
|
|
|
| class VariationsSeed;
|
| @@ -81,8 +85,12 @@
|
| // Register Variations related prefs in the Profile prefs.
|
| static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry);
|
|
|
| - // Factory method for creating a VariationsService.
|
| - static VariationsService* Create(PrefService* local_state);
|
| + // Factory method for creating a VariationsService. Does not take ownership of
|
| + // |state_manager|. Caller should ensure that |state_manager| is valid for the
|
| + // lifetime of this class.
|
| + static scoped_ptr<VariationsService> Create(
|
| + PrefService* local_state,
|
| + metrics::MetricsStateManager* state_manager);
|
|
|
| // Set the PrefService responsible for getting policy-related preferences,
|
| // such as the restrict parameter.
|
| @@ -103,9 +111,12 @@
|
| const base::Time& date_fetched);
|
|
|
| // This constructor exists for injecting a mock notifier. It is meant for
|
| - // testing only. This instance will take ownership of |notifier|.
|
| + // testing only. This instance will take ownership of |notifier|. Does not
|
| + // take ownership of |state_manager|. Caller should ensure that
|
| + // |state_manager| is valid for the lifetime of this class.
|
| VariationsService(ResourceRequestAllowedNotifier* notifier,
|
| - PrefService* local_state);
|
| + PrefService* local_state,
|
| + metrics::MetricsStateManager* state_manager);
|
|
|
| private:
|
| FRIEND_TEST_ALL_PREFIXES(VariationsServiceTest, DoNotFetchIfOffline);
|
| @@ -117,9 +128,12 @@
|
| FRIEND_TEST_ALL_PREFIXES(VariationsServiceTest, SeedNotStoredWhenNonOKStatus);
|
| FRIEND_TEST_ALL_PREFIXES(VariationsServiceTest, SeedDateUpdatedOn304Status);
|
|
|
| - // Creates the VariationsService with the given |local_state| prefs service.
|
| + // Creates the VariationsService with the given |local_state| prefs service
|
| + // and |state_manager|. Does not take ownership of |state_manager|. Caller
|
| + // should ensure that |state_manager| is valid for the lifetime of this class.
|
| // Use the |Create| factory method to create a VariationsService.
|
| - explicit VariationsService(PrefService* local_state);
|
| + VariationsService(PrefService* local_state,
|
| + metrics::MetricsStateManager* state_manager);
|
|
|
| // Checks if prerequisites for fetching the Variations seed are met, and if
|
| // so, performs the actual fetch using |DoActualFetch|.
|
| @@ -137,6 +151,10 @@
|
| // The pref service used to store persist the variations seed.
|
| PrefService* local_state_;
|
|
|
| + // Used for instantiating entropy providers for variations seed simulation.
|
| + // Weak pointer.
|
| + metrics::MetricsStateManager* state_manager_;
|
| +
|
| // Used to obtain policy-related preferences. Depending on the platform, will
|
| // either be Local State or Profile prefs.
|
| PrefService* policy_pref_service_;
|
|
|