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

Side by Side Diff: chrome/browser/metrics/chrome_metrics_services_manager_client.cc

Issue 2248243002: Enabling sampling of UMA and crash reports on Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Some of Ilya's comments Created 4 years, 4 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "chrome/browser/metrics/chrome_metrics_services_manager_client.h" 5 #include "chrome/browser/metrics/chrome_metrics_services_manager_client.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/feature_list.h" 8 #include "base/feature_list.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 16 matching lines...) Expand all
27 27
28 namespace { 28 namespace {
29 29
30 // Name of the variations param that defines the sampling rate. 30 // Name of the variations param that defines the sampling rate.
31 const char kRateParamName[] = "sampling_rate_per_mille"; 31 const char kRateParamName[] = "sampling_rate_per_mille";
32 32
33 // Metrics reporting feature. This feature, along with user consent, controls if 33 // Metrics reporting feature. This feature, along with user consent, controls if
34 // recording and reporting are enabled. If the feature is enabled, but no 34 // recording and reporting are enabled. If the feature is enabled, but no
35 // consent is given, then there will be no recording or reporting. 35 // consent is given, then there will be no recording or reporting.
36 const base::Feature kMetricsReportingFeature{"MetricsReporting", 36 const base::Feature kMetricsReportingFeature{"MetricsReporting",
37 base::FEATURE_ENABLED_BY_DEFAULT}; 37 base::FEATURE_DISABLED_BY_DEFAULT};
Ilya Sherman 2016/08/24 05:02:50 Hmm, why disabled by default?
jwd 2016/08/24 15:06:28 Oops, was doing that for manual testing, slipped i
38 38
39 // Posts |GoogleUpdateSettings::StoreMetricsClientInfo| on blocking pool thread 39 // Posts |GoogleUpdateSettings::StoreMetricsClientInfo| on blocking pool thread
40 // because it needs access to IO and cannot work from UI thread. 40 // because it needs access to IO and cannot work from UI thread.
41 void PostStoreMetricsClientInfo(const metrics::ClientInfo& client_info) { 41 void PostStoreMetricsClientInfo(const metrics::ClientInfo& client_info) {
42 content::BrowserThread::GetBlockingPool()->PostTask( 42 content::BrowserThread::GetBlockingPool()->PostTask(
43 FROM_HERE, 43 FROM_HERE,
44 base::Bind(&GoogleUpdateSettings::StoreMetricsClientInfo, client_info)); 44 base::Bind(&GoogleUpdateSettings::StoreMetricsClientInfo, client_info));
45 } 45 }
46 46
47 // Only clients that were given an opt-out metrics-reporting consent flow are 47 // Only clients that were given an opt-out metrics-reporting consent flow are
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 ChromeMetricsServicesManagerClient::GetMetricsStateManager() { 175 ChromeMetricsServicesManagerClient::GetMetricsStateManager() {
176 DCHECK(thread_checker_.CalledOnValidThread()); 176 DCHECK(thread_checker_.CalledOnValidThread());
177 if (!metrics_state_manager_) { 177 if (!metrics_state_manager_) {
178 metrics_state_manager_ = metrics::MetricsStateManager::Create( 178 metrics_state_manager_ = metrics::MetricsStateManager::Create(
179 local_state_, enabled_state_provider_.get(), 179 local_state_, enabled_state_provider_.get(),
180 base::Bind(&PostStoreMetricsClientInfo), 180 base::Bind(&PostStoreMetricsClientInfo),
181 base::Bind(&GoogleUpdateSettings::LoadMetricsClientInfo)); 181 base::Bind(&GoogleUpdateSettings::LoadMetricsClientInfo));
182 } 182 }
183 return metrics_state_manager_.get(); 183 return metrics_state_manager_.get();
184 } 184 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698