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

Side by Side Diff: chrome/browser/metrics/variations/variations_seed_store.h

Issue 646733002: Added incident report for variations seed signature mismatch. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Responded to comments. Created 6 years, 2 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
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 #ifndef CHROME_BROWSER_METRICS_VARIATIONS_VARIATIONS_SEED_STORE_H_ 5 #ifndef CHROME_BROWSER_METRICS_VARIATIONS_VARIATIONS_SEED_STORE_H_
6 #define CHROME_BROWSER_METRICS_VARIATIONS_VARIATIONS_SEED_STORE_H_ 6 #define CHROME_BROWSER_METRICS_VARIATIONS_VARIATIONS_SEED_STORE_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 void UpdateSeedDateAndLogDayChange(const base::Time& server_date_fetched); 48 void UpdateSeedDateAndLogDayChange(const base::Time& server_date_fetched);
49 49
50 // Returns the serial number of the last loaded or stored seed. 50 // Returns the serial number of the last loaded or stored seed.
51 const std::string& variations_serial_number() const { 51 const std::string& variations_serial_number() const {
52 return variations_serial_number_; 52 return variations_serial_number_;
53 } 53 }
54 54
55 // Registers Local State prefs used by this class. 55 // Registers Local State prefs used by this class.
56 static void RegisterPrefs(PrefRegistrySimple* registry); 56 static void RegisterPrefs(PrefRegistrySimple* registry);
57 57
58 // If the loaded signature is invalid, returns true and sets
59 // |invalid_signature| to the loaded signature. Otherwise returns false and
Alexei Svitkine (slow) 2014/10/14 18:15:06 I would mention that the content of |invalid_signa
Georges Khalil 2014/10/15 14:41:47 Done.
60 // |invalid_signature| is not modified.
61 bool GetInvalidSignature(std::string* invalid_signature) const;
62
58 protected: 63 protected:
59 // Note: UMA histogram enum - don't re-order or remove entries. 64 // Note: UMA histogram enum - don't re-order or remove entries.
60 enum VerifySignatureResult { 65 enum VerifySignatureResult {
61 VARIATIONS_SEED_SIGNATURE_MISSING, 66 VARIATIONS_SEED_SIGNATURE_MISSING,
62 VARIATIONS_SEED_SIGNATURE_DECODE_FAILED, 67 VARIATIONS_SEED_SIGNATURE_DECODE_FAILED,
63 VARIATIONS_SEED_SIGNATURE_INVALID_SIGNATURE, 68 VARIATIONS_SEED_SIGNATURE_INVALID_SIGNATURE,
64 VARIATIONS_SEED_SIGNATURE_INVALID_SEED, 69 VARIATIONS_SEED_SIGNATURE_INVALID_SEED,
65 VARIATIONS_SEED_SIGNATURE_VALID, 70 VARIATIONS_SEED_SIGNATURE_VALID,
66 VARIATIONS_SEED_SIGNATURE_ENUM_SIZE, 71 VARIATIONS_SEED_SIGNATURE_ENUM_SIZE,
67 }; 72 };
(...skipping 13 matching lines...) Expand all
81 86
82 // Clears all prefs related to variations seed storage. 87 // Clears all prefs related to variations seed storage.
83 void ClearPrefs(); 88 void ClearPrefs();
84 89
85 // The pref service used to persist the variations seed. 90 // The pref service used to persist the variations seed.
86 PrefService* local_state_; 91 PrefService* local_state_;
87 92
88 // Cached serial number from the most recently fetched variations seed. 93 // Cached serial number from the most recently fetched variations seed.
89 std::string variations_serial_number_; 94 std::string variations_serial_number_;
90 95
96 // Keeps track of an invalid signature.
97 bool is_invalid_signature_;
98 std::string invalid_signature_;
99
91 DISALLOW_COPY_AND_ASSIGN(VariationsSeedStore); 100 DISALLOW_COPY_AND_ASSIGN(VariationsSeedStore);
92 }; 101 };
93 102
94 } // namespace chrome_variations 103 } // namespace chrome_variations
95 104
96 #endif // CHROME_BROWSER_METRICS_VARIATIONS_VARIATIONS_SEED_STORE_H_ 105 #endif // CHROME_BROWSER_METRICS_VARIATIONS_VARIATIONS_SEED_STORE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698