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

Unified Diff: chromeos/cryptohome/system_salt_getter.h

Issue 2220433002: ChromeOS: fix crash in HashWallpaperFilesIdStr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: AddOnSystemSaltReady() should immediately run callback if system salt is ready. Created 4 years, 4 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 a42dd251f8bf96067ae360e6c7f9e91ec7b84823..a77d85c1e601a9256b2ac186ede05cbc9cba579c 100644
--- a/chromeos/cryptohome/system_salt_getter.h
+++ b/chromeos/cryptohome/system_salt_getter.h
@@ -39,6 +39,10 @@ class CHROMEOS_EXPORT SystemSaltGetter {
// an empty string (e.g. errors in D-Bus layer)
void GetSystemSalt(const GetSystemSaltCallback& callback);
+ // Adds another callback to be called when system salt is received.
+ // (If system salt is available, closure will be called immediately).
+ void AddOnSystemSaltReady(const base::Closure& closure);
+
// Returns pointer to binary system salt if it is already known.
// Returns nullptr if system salt is not known.
const RawSalt* GetRawSalt() const;
@@ -61,6 +65,9 @@ class CHROMEOS_EXPORT SystemSaltGetter {
RawSalt raw_salt_;
std::string system_salt_;
+ // List of callbacks waiting for system salt ready event.
+ std::vector<base::Closure> on_system_salt_ready_;
+
base::WeakPtrFactory<SystemSaltGetter> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(SystemSaltGetter);
« no previous file with comments | « chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.cc ('k') | chromeos/cryptohome/system_salt_getter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698