Chromium Code Reviews| Index: chromeos/cryptohome/system_salt_getter.h |
| diff --git a/chromeos/cryptohome/system_salt_getter.h b/chromeos/cryptohome/system_salt_getter.h |
| index 8654e50635181b2e6a9b94b4c8f66886c126108b..d531ed993e6d0e47819e5d280d6fe9599a916a1d 100644 |
| --- a/chromeos/cryptohome/system_salt_getter.h |
| +++ b/chromeos/cryptohome/system_salt_getter.h |
| @@ -24,6 +24,8 @@ class CHROMEOS_EXPORT SystemSaltGetter { |
| typedef base::Callback<void(const std::string& system_salt)> |
| GetSystemSaltCallback; |
| + using RawSalt = std::vector<uint8_t>; |
| + |
| // Manage an explicitly initialized global instance. |
| static void Initialize(); |
| static bool IsInitialized(); |
| @@ -31,13 +33,19 @@ class CHROMEOS_EXPORT SystemSaltGetter { |
| static SystemSaltGetter* Get(); |
| // Converts |salt| to a hex encoded string. |
| - static std::string ConvertRawSaltToHexString( |
| - const std::vector<uint8_t>& salt); |
| + static std::string ConvertRawSaltToHexString(const RawSalt& salt); |
| // Returns system hash in hex encoded ascii format. Note: this may return |
| // an empty string (e.g. errors in D-Bus layer) |
| void GetSystemSalt(const GetSystemSaltCallback& callback); |
| + // Returns pointer to binary system salt if it is already known. |
| + // Returns nullptr if system salt is not known. |
| + const SystemSaltGetter::RawSalt* GetRawSalt() const; |
|
Darren Krahn
2016/04/13 16:33:44
nit: SystemSaltGetter:: not necessary
Alexander Alekseev
2016/04/14 03:37:29
Done.
|
| + |
| + // This is for browser tests API. |
| + void SetRawSaltForTesting(const SystemSaltGetter::RawSalt& raw_salt); |
|
Darren Krahn
2016/04/13 16:33:43
nit: Here too
Alexander Alekseev
2016/04/14 03:37:29
Done.
|
| + |
| protected: |
| SystemSaltGetter(); |
| ~SystemSaltGetter(); |
| @@ -48,8 +56,9 @@ class CHROMEOS_EXPORT SystemSaltGetter { |
| bool service_is_available); |
| void DidGetSystemSalt(const GetSystemSaltCallback& callback, |
| DBusMethodCallStatus call_status, |
| - const std::vector<uint8_t>& system_salt); |
| + const RawSalt& system_salt); |
| + RawSalt raw_salt_; |
| std::string system_salt_; |
| base::WeakPtrFactory<SystemSaltGetter> weak_ptr_factory_; |