Chromium Code Reviews| Index: chrome/browser/metrics/variations/variations_seed_store.cc |
| diff --git a/chrome/browser/metrics/variations/variations_seed_store.cc b/chrome/browser/metrics/variations/variations_seed_store.cc |
| index be775309989c3c1b3aef14a3ec04b1df0458414e..f50871a053b06e784c3eb6e3d534d0e8ea70e45b 100644 |
| --- a/chrome/browser/metrics/variations/variations_seed_store.cc |
| +++ b/chrome/browser/metrics/variations/variations_seed_store.cc |
| @@ -113,13 +113,15 @@ VariationsSeedDateChangeState GetSeedDateChangeState( |
| } // namespace |
| VariationsSeedStore::VariationsSeedStore(PrefService* local_state) |
| - : local_state_(local_state) { |
| + : is_invalid_signature_(false), local_state_(local_state) { |
| } |
| VariationsSeedStore::~VariationsSeedStore() { |
| } |
| bool VariationsSeedStore::LoadSeed(variations::VariationsSeed* seed) { |
| + invalid_signature_.clear(); |
| + is_invalid_signature_ = false; |
| const std::string base64_seed_data = |
| local_state_->GetString(prefs::kVariationsSeed); |
| if (base64_seed_data.empty()) { |
| @@ -150,6 +152,9 @@ bool VariationsSeedStore::LoadSeed(variations::VariationsSeed* seed) { |
| << "with result: " << result << ". Clearing the pref."; |
| ClearPrefs(); |
| RecordVariationSeedEmptyHistogram(VARIATIONS_SEED_INVALID_SIGNATURE); |
| + // Record the invalid signature. |
| + is_invalid_signature_ = true; |
| + invalid_signature_ = base64_seed_signature; |
| return false; |
| } |
| } |
| @@ -272,4 +277,13 @@ VariationsSeedStore::VerifySeedSignature( |
| return VARIATIONS_SEED_SIGNATURE_INVALID_SEED; |
| } |
| +bool VariationsSeedStore::GetInvalidSignature( |
| + std::string* invalid_signature) const { |
| + if (!is_invalid_signature_) { |
|
Alexei Svitkine (slow)
2014/10/14 17:30:01
Nit: No need for {}'s if body is a single line.
Georges Khalil
2014/10/14 18:00:32
Done.
|
| + return false; |
| + } |
| + *invalid_signature = invalid_signature_; |
| + return true; |
| +} |
| + |
| } // namespace chrome_variations |