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

Side by Side Diff: components/rappor/rappor_service.cc

Issue 421663003: Move variations component code to variations namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Fix 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "components/rappor/rappor_service.h" 5 #include "components/rappor/rappor_service.h"
6 6
7 #include "base/base64.h" 7 #include "base/base64.h"
8 #include "base/metrics/field_trial.h" 8 #include "base/metrics/field_trial.h"
9 #include "base/prefs/pref_registry_simple.h" 9 #include "base/prefs/pref_registry_simple.h"
10 #include "base/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
(...skipping 21 matching lines...) Expand all
32 // Constants for the RAPPOR rollout field trial. 32 // Constants for the RAPPOR rollout field trial.
33 const char kRapporRolloutFieldTrialName[] = "RapporRollout"; 33 const char kRapporRolloutFieldTrialName[] = "RapporRollout";
34 34
35 // Constant for the finch parameter name for the server URL 35 // Constant for the finch parameter name for the server URL
36 const char kRapporRolloutServerUrlParam[] = "ServerUrl"; 36 const char kRapporRolloutServerUrlParam[] = "ServerUrl";
37 37
38 // The rappor server's URL. 38 // The rappor server's URL.
39 const char kDefaultServerUrl[] = "https://clients4.google.com/rappor"; 39 const char kDefaultServerUrl[] = "https://clients4.google.com/rappor";
40 40
41 GURL GetServerUrl() { 41 GURL GetServerUrl() {
42 std::string server_url = chrome_variations::GetVariationParamValue( 42 std::string server_url = variations::GetVariationParamValue(
43 kRapporRolloutFieldTrialName, 43 kRapporRolloutFieldTrialName,
44 kRapporRolloutServerUrlParam); 44 kRapporRolloutServerUrlParam);
45 if (!server_url.empty()) 45 if (!server_url.empty())
46 return GURL(server_url); 46 return GURL(server_url);
47 else 47 else
48 return GURL(kDefaultServerUrl); 48 return GURL(kDefaultServerUrl);
49 } 49 }
50 50
51 const RapporParameters kRapporParametersForType[NUM_RAPPOR_TYPES] = { 51 const RapporParameters kRapporParametersForType[NUM_RAPPOR_TYPES] = {
52 // ETLD_PLUS_ONE_RAPPOR_TYPE 52 // ETLD_PLUS_ONE_RAPPOR_TYPE
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 DCHECK_EQ(parameters.ToString(), metric->parameters().ToString()); 191 DCHECK_EQ(parameters.ToString(), metric->parameters().ToString());
192 return metric; 192 return metric;
193 } 193 }
194 194
195 RapporMetric* new_metric = new RapporMetric(metric_name, parameters, cohort_); 195 RapporMetric* new_metric = new RapporMetric(metric_name, parameters, cohort_);
196 metrics_map_[metric_name] = new_metric; 196 metrics_map_[metric_name] = new_metric;
197 return new_metric; 197 return new_metric;
198 } 198 }
199 199
200 } // namespace rappor 200 } // namespace rappor
OLDNEW
« no previous file with comments | « chrome/common/variations/uniformity_field_trials.cc ('k') | components/suggestions/suggestions_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698