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

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

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.cc
diff --git a/chrome/browser/metrics/variations/variations_service.cc b/chrome/browser/metrics/variations/variations_service.cc
index 642b1ef3affb73efb01b9833a828e473e5ee8040..ee5f0eb40c952552d033bfe45e9f5af3832554f4 100644
--- a/chrome/browser/metrics/variations/variations_service.cc
+++ b/chrome/browser/metrics/variations/variations_service.cc
@@ -210,7 +210,7 @@ std::string GetHeaderValue(const net::HttpResponseHeaders* headers,
VariationsService::VariationsService(
scoped_ptr<VariationsServiceClient> client,
- web_resource::ResourceRequestAllowedNotifier* notifier,
+ scoped_ptr<web_resource::ResourceRequestAllowedNotifier> notifier,
PrefService* local_state,
metrics::MetricsStateManager* state_manager)
: client_(client.Pass()),
@@ -221,7 +221,7 @@ VariationsService::VariationsService(
create_trials_from_seed_called_(false),
initial_request_completed_(false),
disable_deltas_for_next_request_(false),
- resource_request_allowed_notifier_(notifier),
+ resource_request_allowed_notifier_(notifier.Pass()),
request_count_(0),
weak_ptr_factory_(this) {
resource_request_allowed_notifier_->Init(this);
@@ -365,7 +365,6 @@ void VariationsService::SetCreateTrialsFromSeedCalledForTesting(bool called) {
create_trials_from_seed_called_ = called;
}
-// static
GURL VariationsService::GetVariationsServerURL(
PrefService* policy_pref_service,
const std::string& restrict_mode_override) {
@@ -436,12 +435,20 @@ scoped_ptr<VariationsService> VariationsService::Create(
}
#endif
result.reset(new VariationsService(
- client.Pass(), new web_resource::ResourceRequestAllowedNotifier(
- local_state, disable_network_switch),
+ client.Pass(),
+ make_scoped_ptr(new web_resource::ResourceRequestAllowedNotifier(
+ local_state, disable_network_switch)),
local_state, state_manager));
return result.Pass();
}
+// static
+scoped_ptr<VariationsService> VariationsService::CreateForTesting(
+ scoped_ptr<VariationsServiceClient> client,
+ PrefService* local_state) {
+ return Create(client.Pass(), local_state, nullptr, nullptr);
+}
+
void VariationsService::DoActualFetch() {
DCHECK(thread_checker_.CalledOnValidThread());
DCHECK(!pending_seed_request_);

Powered by Google App Engine
This is Rietveld 408576698