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

Unified Diff: chromeos/cryptohome/system_salt_getter.h

Issue 1886653002: Remove WallpaperManager dependency on Cryptohome. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix tests. Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
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_;

Powered by Google App Engine
This is Rietveld 408576698