Index: chromeos/cryptohome/async_method_caller.cc |
diff --git a/chromeos/cryptohome/async_method_caller.cc b/chromeos/cryptohome/async_method_caller.cc |
index 0b137b035fee2fd0e3bbecc45ba1f193ef4da49d..f45d1a2cbea5eccb5894500f2ce3cd4cf3d178a9 100644 |
--- a/chromeos/cryptohome/async_method_caller.cc |
+++ b/chromeos/cryptohome/async_method_caller.cc |
@@ -308,10 +308,17 @@ class AsyncMethodCallerImpl : public AsyncMethodCaller { |
base::Bind(it->second.data_callback, return_status, return_data)); |
data_callback_map_.erase(it); |
} |
- |
// Registers a callback which is called when the result for AsyncXXX is ready. |
void RegisterAsyncCallback( |
Callback callback, const char* error, int async_id) { |
+ if (async_id == chromeos::CryptohomeClient::kNotReadyAsyncId) { |
+ base::MessageLoopProxy::current()->PostTask( |
+ FROM_HERE, base::Bind(callback, |
+ false, // return status |
+ cryptohome::MOUNT_ERROR_FATAL)); |
+ return; |
+ } |
+ |
if (async_id == 0) { |
LOG(ERROR) << error; |
return; |
@@ -325,6 +332,13 @@ class AsyncMethodCallerImpl : public AsyncMethodCaller { |
// Registers a callback which is called when the result for AsyncXXX is ready. |
void RegisterAsyncDataCallback( |
DataCallback callback, const char* error, int async_id) { |
+ if (async_id == chromeos::CryptohomeClient::kNotReadyAsyncId) { |
+ base::MessageLoopProxy::current()->PostTask( |
+ FROM_HERE, base::Bind(callback, |
+ false, // return status |
+ std::string())); |
+ return; |
+ } |
if (async_id == 0) { |
LOG(ERROR) << error; |
return; |