Chromium Code Reviews| Index: chromeos/cryptohome/system_salt_getter.cc |
| diff --git a/chromeos/cryptohome/system_salt_getter.cc b/chromeos/cryptohome/system_salt_getter.cc |
| index 48f565e90a350f0fcaceeb5a01fab74edd9a85f1..bfe35961600d6374b5cf64d5604e2519f315dc26 100644 |
| --- a/chromeos/cryptohome/system_salt_getter.cc |
| +++ b/chromeos/cryptohome/system_salt_getter.cc |
| @@ -42,6 +42,10 @@ void SystemSaltGetter::GetSystemSalt( |
| callback)); |
| } |
| +void SystemSaltGetter::AddOnSystemSaltReady(const base::Closure& closure) { |
| + on_system_salt_ready_.push_back(closure); |
|
Darren Krahn
2016/08/05 18:54:56
Should the closure be called if salt is already av
Alexander Alekseev
2016/08/06 05:00:12
Done.
|
| +} |
| + |
| const SystemSaltGetter::RawSalt* SystemSaltGetter::GetRawSalt() const { |
| return raw_salt_.empty() ? nullptr : &raw_salt_; |
| } |
| @@ -74,6 +78,12 @@ void SystemSaltGetter::DidGetSystemSalt( |
| system_salt.size() % 2 == 0U) { |
| raw_salt_ = system_salt; |
| system_salt_ = ConvertRawSaltToHexString(system_salt); |
| + |
| + std::vector<base::Closure> callbacks; |
| + callbacks.swap(on_system_salt_ready_); |
| + for (const base::Closure& callback : callbacks) { |
| + callback.Run(); |
| + } |
| } else { |
| LOG(WARNING) << "System salt not available"; |
| } |