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

Unified Diff: components/variations/caching_permuted_entropy_provider.cc

Issue 293623003: [Metrics] Move CachingPermutedEntropyProvider into the variations component. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add a newline Created 6 years, 7 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
Index: components/variations/caching_permuted_entropy_provider.cc
diff --git a/chrome/common/metrics/caching_permuted_entropy_provider.cc b/components/variations/caching_permuted_entropy_provider.cc
similarity index 86%
rename from chrome/common/metrics/caching_permuted_entropy_provider.cc
rename to components/variations/caching_permuted_entropy_provider.cc
index 2432f3f97a0d05f91efef290a5728dd805e1d404..c4b6bd71b5bf2960e323751941cd3294d24e9b3e 100644
--- a/chrome/common/metrics/caching_permuted_entropy_provider.cc
+++ b/components/variations/caching_permuted_entropy_provider.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/common/metrics/caching_permuted_entropy_provider.h"
+#include "components/variations/caching_permuted_entropy_provider.h"
#include <string>
@@ -10,7 +10,7 @@
#include "base/logging.h"
#include "base/prefs/pref_registry_simple.h"
#include "base/prefs/pref_service.h"
-#include "chrome/common/pref_names.h"
+#include "components/variations/pref_names.h"
namespace metrics {
@@ -29,13 +29,13 @@ CachingPermutedEntropyProvider::~CachingPermutedEntropyProvider() {
// static
void CachingPermutedEntropyProvider::RegisterPrefs(
PrefRegistrySimple* registry) {
- registry->RegisterStringPref(prefs::kMetricsPermutedEntropyCache,
+ registry->RegisterStringPref(prefs::kVariationsPermutedEntropyCache,
std::string());
}
// static
void CachingPermutedEntropyProvider::ClearCache(PrefService* local_state) {
- local_state->ClearPref(prefs::kMetricsPermutedEntropyCache);
+ local_state->ClearPref(prefs::kVariationsPermutedEntropyCache);
}
uint16 CachingPermutedEntropyProvider::GetPermutedValue(
@@ -52,11 +52,11 @@ uint16 CachingPermutedEntropyProvider::GetPermutedValue(
void CachingPermutedEntropyProvider::ReadFromLocalState() const {
const std::string base64_cache_data =
- local_state_->GetString(prefs::kMetricsPermutedEntropyCache);
+ local_state_->GetString(prefs::kVariationsPermutedEntropyCache);
std::string cache_data;
if (!base::Base64Decode(base64_cache_data, &cache_data) ||
!cache_.ParseFromString(cache_data)) {
- local_state_->ClearPref(prefs::kMetricsPermutedEntropyCache);
+ local_state_->ClearPref(prefs::kVariationsPermutedEntropyCache);
NOTREACHED();
}
}
@@ -67,7 +67,8 @@ void CachingPermutedEntropyProvider::UpdateLocalState() const {
std::string base64_encoded;
base::Base64Encode(serialized, &base64_encoded);
- local_state_->SetString(prefs::kMetricsPermutedEntropyCache, base64_encoded);
+ local_state_->SetString(prefs::kVariationsPermutedEntropyCache,
+ base64_encoded);
}
void CachingPermutedEntropyProvider::AddToCache(uint32 randomization_seed,

Powered by Google App Engine
This is Rietveld 408576698