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

Unified Diff: components/rappor/rappor_service.cc

Issue 430703002: Create variations param for RapporRollout to non-UMA users. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/rappor/rappor_service.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/rappor/rappor_service.cc
diff --git a/components/rappor/rappor_service.cc b/components/rappor/rappor_service.cc
index 0f79d8e39833bb0e3e6ac76e199d893fa78b850c..6ca64b70f94b8b2cf3e8924d5949d64726bacafa 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();
« no previous file with comments | « components/rappor/rappor_service.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698