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

Side by Side Diff: ios/chrome/browser/ios_chrome_main_parts.mm

Issue 1859213002: Move the thread hop for UMA user actions from content:: to base::. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moved call to SetRecordActionTaskRunner. Created 4 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ios/chrome/browser/ios_chrome_main_parts.h" 5 #include "ios/chrome/browser/ios_chrome_main_parts.h"
6 6
7 #include "base/base_switches.h" 7 #include "base/base_switches.h"
8 #include "base/feature_list.h" 8 #include "base/feature_list.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "base/memory/ptr_util.h" 11 #include "base/memory/ptr_util.h"
12 #include "base/metrics/user_metrics.h"
12 #include "base/path_service.h" 13 #include "base/path_service.h"
13 #include "base/time/default_tick_clock.h" 14 #include "base/time/default_tick_clock.h"
14 #include "components/content_settings/core/browser/cookie_settings.h" 15 #include "components/content_settings/core/browser/cookie_settings.h"
15 #include "components/content_settings/core/common/content_settings_pattern.h" 16 #include "components/content_settings/core/common/content_settings_pattern.h"
16 #include "components/flags_ui/pref_service_flags_storage.h" 17 #include "components/flags_ui/pref_service_flags_storage.h"
17 #include "components/language_usage_metrics/language_usage_metrics.h" 18 #include "components/language_usage_metrics/language_usage_metrics.h"
18 #include "components/metrics/metrics_service.h" 19 #include "components/metrics/metrics_service.h"
19 #include "components/metrics/profiler/ios/ios_tracking_synchronizer_delegate.h" 20 #include "components/metrics/profiler/ios/ios_tracking_synchronizer_delegate.h"
20 #include "components/metrics/profiler/tracking_synchronizer.h" 21 #include "components/metrics/profiler/tracking_synchronizer.h"
21 #include "components/metrics_services_manager/metrics_services_manager.h" 22 #include "components/metrics_services_manager/metrics_services_manager.h"
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 TranslateServiceIOS::Shutdown(); 183 TranslateServiceIOS::Shutdown();
183 application_context_->StartTearDown(); 184 application_context_->StartTearDown();
184 } 185 }
185 186
186 void IOSChromeMainParts::PostDestroyThreads() { 187 void IOSChromeMainParts::PostDestroyThreads() {
187 application_context_->PostDestroyThreads(); 188 application_context_->PostDestroyThreads();
188 } 189 }
189 190
190 // This will be called after the command-line has been mutated by about:flags 191 // This will be called after the command-line has been mutated by about:flags
191 void IOSChromeMainParts::SetUpMetricsAndFieldTrials() { 192 void IOSChromeMainParts::SetUpMetricsAndFieldTrials() {
193 // Set the thread on which to execute RecordAction.
Ilya Sherman 2016/04/15 22:16:05 Ditto.
beaudoin 2016/04/18 14:29:52 Done.
194 base::SetRecordActionTaskRunner(
195 web::WebThread::GetTaskRunnerForThread(web::WebThread::UI););
196
192 // Must initialize metrics after labs have been converted into switches, 197 // Must initialize metrics after labs have been converted into switches,
193 // but before field trials are set up (so that client ID is available for 198 // but before field trials are set up (so that client ID is available for
194 // one-time randomized field trials). 199 // one-time randomized field trials).
195 metrics::MetricsService* metrics = application_context_->GetMetricsService(); 200 metrics::MetricsService* metrics = application_context_->GetMetricsService();
196 201
197 // Initialize FieldTrialList to support FieldTrials that use one-time 202 // Initialize FieldTrialList to support FieldTrials that use one-time
198 // randomization. 203 // randomization.
199 field_trial_list_.reset( 204 field_trial_list_.reset(
200 new base::FieldTrialList(metrics->CreateEntropyProvider().release())); 205 new base::FieldTrialList(metrics->CreateEntropyProvider().release()));
201 206
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 248
244 void IOSChromeMainParts::StartMetricsRecording() { 249 void IOSChromeMainParts::StartMetricsRecording() {
245 bool wifiOnly = local_state_->GetBoolean(prefs::kMetricsReportingWifiOnly); 250 bool wifiOnly = local_state_->GetBoolean(prefs::kMetricsReportingWifiOnly);
246 bool isConnectionCellular = net::NetworkChangeNotifier::IsConnectionCellular( 251 bool isConnectionCellular = net::NetworkChangeNotifier::IsConnectionCellular(
247 net::NetworkChangeNotifier::GetConnectionType()); 252 net::NetworkChangeNotifier::GetConnectionType());
248 bool mayUpload = !wifiOnly || !isConnectionCellular; 253 bool mayUpload = !wifiOnly || !isConnectionCellular;
249 254
250 application_context_->GetMetricsServicesManager()->UpdateUploadPermissions( 255 application_context_->GetMetricsServicesManager()->UpdateUploadPermissions(
251 mayUpload); 256 mayUpload);
252 } 257 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698