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..a42dd251f8bf96067ae360e6c7f9e91ec7b84823 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 RawSalt* GetRawSalt() const; |
+ |
+ // This is for browser tests API. |
+ void SetRawSaltForTesting(const RawSalt& raw_salt); |
+ |
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_; |