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

Unified Diff: chrome/browser/metrics/variations/variations_service.h

Issue 1313213005: Turn VariationsService::GetVariationsServerURL into instance method (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 3 months 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
Index: chrome/browser/metrics/variations/variations_service.h
diff --git a/chrome/browser/metrics/variations/variations_service.h b/chrome/browser/metrics/variations/variations_service.h
index 668f48d14e654634a88a79e747e7966f97ef72fb..be518fb5b391dd65260d9ce42cdde083777ef260 100644
--- a/chrome/browser/metrics/variations/variations_service.h
+++ b/chrome/browser/metrics/variations/variations_service.h
@@ -109,8 +109,8 @@ class VariationsService
// Returns the variations server URL, which can vary if a command-line flag is
// set and/or the variations restrict pref is set in |local_prefs|. Declared
// static for test purposes.
- static GURL GetVariationsServerURL(PrefService* local_prefs,
- const std::string& restrict_mode_override);
+ GURL GetVariationsServerURL(PrefService* local_prefs,
+ const std::string& restrict_mode_override);
// Exposed for testing.
static std::string GetDefaultVariationsServerURLForTesting();
@@ -130,6 +130,11 @@ class VariationsService
metrics::MetricsStateManager* state_manager,
const char* disable_network_switch);
+ // Factory method for creating a VariationsService in a testing context.
+ static scoped_ptr<VariationsService> CreateForTesting(
+ scoped_ptr<VariationsServiceClient> client,
+ PrefService* local_state);
+
// Set the PrefService responsible for getting policy-related preferences,
// such as the restrict parameter.
void set_policy_pref_service(PrefService* service) {
@@ -156,14 +161,14 @@ class VariationsService
bool is_delta_compressed);
// Creates the VariationsService with the given |local_state| prefs service
- // and |state_manager|. 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. Use the |Create|
- // factory method to create a VariationsService.
- VariationsService(scoped_ptr<VariationsServiceClient> client,
- web_resource::ResourceRequestAllowedNotifier* notifier,
- PrefService* local_state,
- metrics::MetricsStateManager* state_manager);
+ // 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.
+ VariationsService(
+ scoped_ptr<VariationsServiceClient> client,
+ scoped_ptr<web_resource::ResourceRequestAllowedNotifier> notifier,
+ PrefService* local_state,
+ metrics::MetricsStateManager* state_manager);
private:
FRIEND_TEST_ALL_PREFIXES(VariationsServiceTest, Observer);

Powered by Google App Engine
This is Rietveld 408576698