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

Unified Diff: chromeos/dbus/cryptohome_client.cc

Issue 12094075: Added GetSanitizedUsername() method to CryptohomeClient. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 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') | chromeos/dbus/mock_cryptohome_client.h » ('j') | 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 276cd892c91433ddbccafb8024bc3741c36f4f68..436fcd45648348311121750f6dda417571a845b6 100644
--- a/chromeos/dbus/cryptohome_client.cc
+++ b/chromeos/dbus/cryptohome_client.cc
@@ -133,6 +133,20 @@ class CryptohomeClientImpl : public CryptohomeClient {
return true;
}
+ // CryptohomeClient override,
+ virtual void GetSanitizedUsername(
+ const std::string& username,
+ const StringDBusMethodCallback& callback) OVERRIDE {
+ INITIALIZE_METHOD_CALL(method_call,
+ cryptohome::kCryptohomeGetSanitizedUsername);
+ dbus::MessageWriter writer(&method_call);
+ writer.AppendString(username);
+ proxy_->CallMethod(&method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
+ base::Bind(&CryptohomeClientImpl::OnStringMethod,
+ weak_ptr_factory_.GetWeakPtr(),
+ callback));
+ }
+
// CryptohomeClient override.
virtual void AsyncMount(const std::string& username,
const std::string& key,
@@ -610,6 +624,17 @@ class CryptohomeClientStubImpl : public CryptohomeClient {
}
// CryptohomeClient override.
+ virtual void GetSanitizedUsername(
+ const std::string& username,
+ const StringDBusMethodCallback& callback) OVERRIDE {
+ const char kStubSanitizedUsername[] =
+ "0123456789ABCDEF0123456789ABCDEF01234567";
+ MessageLoop::current()->PostTask(
+ FROM_HERE,
+ base::Bind(callback, DBUS_METHOD_CALL_SUCCESS, kStubSanitizedUsername));
+ }
+
+ // CryptohomeClient override.
virtual void AsyncMount(const std::string& username,
const std::string& key,
int flags,
« no previous file with comments | « chromeos/dbus/cryptohome_client.h ('k') | chromeos/dbus/mock_cryptohome_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698