summaryrefslogtreecommitdiffstats
path: root/components/rappor
diff options
context:
space:
mode:
authorholte@chromium.org <holte@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-08-07 20:02:38 +0000
committerholte@chromium.org <holte@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-08-07 20:02:38 +0000
commitf861eca6348813dad549cea12170ea5f056c8cea (patch)
treea7b69be3762b0d1f940893ca0f0ee4bf29bb2b6d /components/rappor
parent22aa4f5f8580f61dca90e613c4153c8ac704ec73 (diff)
downloadchromium_src-f861eca6348813dad549cea12170ea5f056c8cea.zip
chromium_src-f861eca6348813dad549cea12170ea5f056c8cea.tar.gz
chromium_src-f861eca6348813dad549cea12170ea5f056c8cea.tar.bz2
Create variations param for RapporRollout to non-UMA users.
BUG=400861 Review URL: https://codereview.chromium.org/430703002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@288127 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'components/rappor')
-rw-r--r--components/rappor/rappor_service.cc19
-rw-r--r--components/rappor/rappor_service.h4
2 files changed, 17 insertions, 6 deletions
diff --git a/components/rappor/rappor_service.cc b/components/rappor/rappor_service.cc
index 0f79d8e..6ca64b7 100644
--- a/components/rappor/rappor_service.cc
+++ b/components/rappor/rappor_service.cc
@@ -35,10 +35,18 @@ const char kRapporRolloutFieldTrialName[] = "RapporRollout";
// Constant for the finch parameter name for the server URL
const char kRapporRolloutServerUrlParam[] = "ServerUrl";
+// Constant for the finch parameter name for the server URL
+const char kRapporRolloutRequireUmaParam[] = "RequireUma";
+
// The rappor server's URL.
const char kDefaultServerUrl[] = "https://clients4.google.com/rappor";
-GURL GetServerUrl() {
+GURL GetServerUrl(bool metrics_enabled) {
+ bool require_uma = variations::GetVariationParamValue(
+ kRapporRolloutFieldTrialName,
+ kRapporRolloutRequireUmaParam) != "False";
+ if (!metrics_enabled && require_uma)
+ return GURL(); // Invalid URL disables Rappor.
std::string server_url = variations::GetVariationParamValue(
kRapporRolloutFieldTrialName,
kRapporRolloutServerUrlParam);
@@ -68,11 +76,12 @@ RapporService::~RapporService() {
}
void RapporService::Start(PrefService* pref_service,
- net::URLRequestContextGetter* request_context) {
- const GURL server_url = GetServerUrl();
+ net::URLRequestContextGetter* request_context,
+ bool metrics_enabled) {
+ const GURL server_url = GetServerUrl(metrics_enabled);
if (!server_url.is_valid()) {
- DVLOG(1) << "RapporService not started: "
- << server_url.spec() << " is invalid.";
+ DVLOG(1) << server_url.spec() << " is invalid. "
+ << "RapporService not started.";
return;
}
DVLOG(1) << "RapporService started. Reporting to " << server_url.spec();
diff --git a/components/rappor/rappor_service.h b/components/rappor/rappor_service.h
index 323e9ba..f02a85a 100644
--- a/components/rappor/rappor_service.h
+++ b/components/rappor/rappor_service.h
@@ -42,7 +42,9 @@ class RapporService {
virtual ~RapporService();
// Starts the periodic generation of reports and upload attempts.
- void Start(PrefService* pref_service, net::URLRequestContextGetter* context);
+ void Start(PrefService* pref_service,
+ net::URLRequestContextGetter* context,
+ bool metrics_enabled);
// Records a sample of the rappor metric specified by |metric_name|.
// Creates and initializes the metric, if it doesn't yet exist.