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

Unified Diff: ios/chrome/browser/ios_chrome_main_parts.mm

Issue 2333283005: Move EntropyProvider Source From MetricsService to MetricsServicesManager (Closed)
Patch Set: Created 4 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: ios/chrome/browser/ios_chrome_main_parts.mm
diff --git a/ios/chrome/browser/ios_chrome_main_parts.mm b/ios/chrome/browser/ios_chrome_main_parts.mm
index a3ede343d21b4ec794dc59a4e44c0c30acfe2006..92c75268608c53909ce3c389875fa15aeb70a499 100644
--- a/ios/chrome/browser/ios_chrome_main_parts.mm
+++ b/ios/chrome/browser/ios_chrome_main_parts.mm
@@ -193,15 +193,12 @@ void IOSChromeMainParts::SetUpMetricsAndFieldTrials() {
base::SetRecordActionTaskRunner(
web::WebThread::GetTaskRunnerForThread(web::WebThread::UI));
- // Must initialize metrics after labs have been converted into switches,
- // but before field trials are set up (so that client ID is available for
- // one-time randomized field trials).
- metrics::MetricsService* metrics = application_context_->GetMetricsService();
-
// Initialize FieldTrialList to support FieldTrials that use one-time
// randomization.
Alexei Svitkine (slow) 2016/09/14 20:26:37 Can you add the DCHECK() that's in the non-iOS cod
robliao 2016/09/14 20:54:42 Done.
field_trial_list_.reset(
- new base::FieldTrialList(metrics->CreateEntropyProvider().release()));
+ new base::FieldTrialList(application_context_->GetMetricsServicesManager()
+ ->CreateEntropyProvider()
+ .release()));
const base::CommandLine* command_line =
base::CommandLine::ForCurrentProcess();
@@ -225,6 +222,11 @@ void IOSChromeMainParts::SetUpMetricsAndFieldTrials() {
std::vector<std::string> variation_ids =
RegisterAllFeatureVariationParameters(&flags_storage, feature_list.get());
+ // Must initialize metrics after labs have been converted into switches,
Alexei Svitkine (slow) 2016/09/14 20:26:38 Nit: "labs" terminology is pretty outdated. Given
robliao 2016/09/14 20:54:42 Done.
+ // but before field trials are set up (so that client ID is available for
+ // one-time randomized field trials).
+ metrics::MetricsService* metrics = application_context_->GetMetricsService();
+
Alexei Svitkine (slow) 2016/09/14 20:26:38 Nit: Make it consistent with the non-iOS code - ei
robliao 2016/09/14 20:54:42 This was lost in a file I forgot to save! It's the
variations::VariationsHttpHeaderProvider* http_header_provider =
variations::VariationsHttpHeaderProvider::GetInstance();
// Force the variation ids selected in chrome://flags and/or specified using

Powered by Google App Engine
This is Rietveld 408576698