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

Unified Diff: components/variations/variations_seed_store.cc

Issue 2919223002: [Cleanup] Remove the obsolete variations_seed pref. (Closed)
Patch Set: Fix the test Created 3 years, 6 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/variations_seed_store.cc
diff --git a/components/variations/variations_seed_store.cc b/components/variations/variations_seed_store.cc
index 647cc8dbf9cba17a2d2f09cc77762dccf168874b..31c6ef520f817d330f3a7b5a20915619e2b7ae3c 100644
--- a/components/variations/variations_seed_store.cc
+++ b/components/variations/variations_seed_store.cc
@@ -307,7 +307,6 @@ std::string VariationsSeedStore::GetInvalidSignature() const {
// static
void VariationsSeedStore::RegisterPrefs(PrefRegistrySimple* registry) {
registry->RegisterStringPref(prefs::kVariationsCompressedSeed, std::string());
- registry->RegisterStringPref(prefs::kVariationsSeed, std::string());
registry->RegisterInt64Pref(prefs::kVariationsSeedDate,
base::Time().ToInternalValue());
registry->RegisterStringPref(prefs::kVariationsSeedSignature, std::string());
@@ -345,7 +344,6 @@ VariationsSeedStore::VerifySeedSignature(
void VariationsSeedStore::ClearPrefs() {
local_state_->ClearPref(prefs::kVariationsCompressedSeed);
- local_state_->ClearPref(prefs::kVariationsSeed);
local_state_->ClearPref(prefs::kVariationsSeedDate);
local_state_->ClearPref(prefs::kVariationsSeedSignature);
}
@@ -387,11 +385,6 @@ void VariationsSeedStore::ImportFirstRunJavaSeed() {
bool VariationsSeedStore::ReadSeedData(std::string* seed_data) {
std::string base64_seed_data =
local_state_->GetString(prefs::kVariationsCompressedSeed);
- const bool is_compressed = !base64_seed_data.empty();
- // If there's no compressed seed, fall back to the uncompressed one.
- if (!is_compressed)
- base64_seed_data = local_state_->GetString(prefs::kVariationsSeed);
-
if (base64_seed_data.empty()) {
RecordVariationSeedEmptyHistogram(VARIATIONS_SEED_EMPTY);
return false;
@@ -405,9 +398,7 @@ bool VariationsSeedStore::ReadSeedData(std::string* seed_data) {
return false;
}
- if (!is_compressed) {
- seed_data->swap(decoded_data);
- } else if (!compression::GzipUncompress(decoded_data, seed_data)) {
+ if (!compression::GzipUncompress(decoded_data, seed_data)) {
ClearPrefs();
RecordVariationSeedEmptyHistogram(VARIATIONS_SEED_CORRUPT_GZIP);
return false;
@@ -455,10 +446,6 @@ bool VariationsSeedStore::StoreSeedDataNoDelta(
std::string base64_seed_data;
base::Base64Encode(compressed_seed_data, &base64_seed_data);
- // TODO(asvitkine): This pref is no longer being used. Remove it completely
- // in M45+.
- local_state_->ClearPref(prefs::kVariationsSeed);
gab 2017/06/06 14:45:03 Since this pref was passed through master_prefs an
Ilya Sherman 2017/06/06 20:22:16 Hmm, that sounds like a bug if this and the other
Ilya Sherman 2017/06/06 21:54:37 Okay, found the docs [1] and then updated them for
-
#if defined(OS_ANDROID)
// If currently we do not have any stored pref then we mark seed storing as
// successful on the Java side of Chrome for Android to avoid repeated seed
« no previous file with comments | « components/variations/service/variations_service_unittest.cc ('k') | components/variations/variations_seed_store_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698