OLD | NEW |
---|---|
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 Loading... | |
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 // Returns the invalid signature in base64 format, or an empty string if the | |
59 // signature was not invalid. | |
grt (UTC plus 2)
2014/10/15 15:08:07
shouldn't this be: "..., or an empty string if the
Alexei Svitkine (slow)
2014/10/15 15:16:30
Yeah, that sounds even better!
Georges Khalil
2014/10/15 16:53:19
Done.
| |
60 std::string GetInvalidSignature() const; | |
61 | |
58 protected: | 62 protected: |
59 // Note: UMA histogram enum - don't re-order or remove entries. | 63 // Note: UMA histogram enum - don't re-order or remove entries. |
60 enum VerifySignatureResult { | 64 enum VerifySignatureResult { |
61 VARIATIONS_SEED_SIGNATURE_MISSING, | 65 VARIATIONS_SEED_SIGNATURE_MISSING, |
62 VARIATIONS_SEED_SIGNATURE_DECODE_FAILED, | 66 VARIATIONS_SEED_SIGNATURE_DECODE_FAILED, |
63 VARIATIONS_SEED_SIGNATURE_INVALID_SIGNATURE, | 67 VARIATIONS_SEED_SIGNATURE_INVALID_SIGNATURE, |
64 VARIATIONS_SEED_SIGNATURE_INVALID_SEED, | 68 VARIATIONS_SEED_SIGNATURE_INVALID_SEED, |
65 VARIATIONS_SEED_SIGNATURE_VALID, | 69 VARIATIONS_SEED_SIGNATURE_VALID, |
66 VARIATIONS_SEED_SIGNATURE_ENUM_SIZE, | 70 VARIATIONS_SEED_SIGNATURE_ENUM_SIZE, |
67 }; | 71 }; |
(...skipping 13 matching lines...) Expand all Loading... | |
81 | 85 |
82 // Clears all prefs related to variations seed storage. | 86 // Clears all prefs related to variations seed storage. |
83 void ClearPrefs(); | 87 void ClearPrefs(); |
84 | 88 |
85 // The pref service used to persist the variations seed. | 89 // The pref service used to persist the variations seed. |
86 PrefService* local_state_; | 90 PrefService* local_state_; |
87 | 91 |
88 // Cached serial number from the most recently fetched variations seed. | 92 // Cached serial number from the most recently fetched variations seed. |
89 std::string variations_serial_number_; | 93 std::string variations_serial_number_; |
90 | 94 |
95 // Keeps track of an invalid signature. | |
96 std::string invalid_base64_signature_; | |
97 | |
91 DISALLOW_COPY_AND_ASSIGN(VariationsSeedStore); | 98 DISALLOW_COPY_AND_ASSIGN(VariationsSeedStore); |
92 }; | 99 }; |
93 | 100 |
94 } // namespace chrome_variations | 101 } // namespace chrome_variations |
95 | 102 |
96 #endif // CHROME_BROWSER_METRICS_VARIATIONS_VARIATIONS_SEED_STORE_H_ | 103 #endif // CHROME_BROWSER_METRICS_VARIATIONS_VARIATIONS_SEED_STORE_H_ |
OLD | NEW |