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

Unified Diff: chromeos/dbus/cryptohome_client.cc

Issue 880303003: Cryptohome: Notify about error in async calls if cryptohome is not ready yet. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update 1 Created 5 years, 11 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
« no previous file with comments | « chromeos/dbus/cryptohome_client.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/dbus/cryptohome_client.cc
diff --git a/chromeos/dbus/cryptohome_client.cc b/chromeos/dbus/cryptohome_client.cc
index 4ccb11646dbd7567edada63528f285843f67901e..e816b91052eb0e67521d6a6039d92505b6344a07 100644
--- a/chromeos/dbus/cryptohome_client.cc
+++ b/chromeos/dbus/cryptohome_client.cc
@@ -20,6 +20,8 @@
namespace chromeos {
+const int CryptohomeClient::kNotReadyAsyncId = -1;
+
namespace {
// This suffix is appended to user_id to get hash in stub implementation:
@@ -882,8 +884,10 @@ class CryptohomeClientImpl : public CryptohomeClient {
// Handles the result of AsyncXXX methods.
void OnAsyncMethodCall(const AsyncMethodCallback& callback,
dbus::Response* response) {
- if (!response)
+ if (!response) {
+ callback.Run(kNotReadyAsyncId);
return;
+ }
dbus::MessageReader reader(response);
int async_id = 0;
if (!reader.PopInt32(&async_id)) {
« no previous file with comments | « chromeos/dbus/cryptohome_client.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698