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

Unified Diff: chromeos/cryptohome/homedir_methods.cc

Issue 2111043003: Storage manager: Show the disk usage of other users. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix typo and the order of storage items. Created 4 years, 6 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/cryptohome/homedir_methods.h ('k') | chromeos/cryptohome/mock_homedir_methods.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/cryptohome/homedir_methods.cc
diff --git a/chromeos/cryptohome/homedir_methods.cc b/chromeos/cryptohome/homedir_methods.cc
index bd276eceeb5206066aed18322303f6299baa117d..efa0cec32334f8cf1bb56daa134d154011c9b716 100644
--- a/chromeos/cryptohome/homedir_methods.cc
+++ b/chromeos/cryptohome/homedir_methods.cc
@@ -286,6 +286,14 @@ class HomedirMethodsImpl : public HomedirMethods {
weak_ptr_factory_.GetWeakPtr(), callback));
}
+ void GetAccountDiskUsage(
+ const Identification& id,
+ const GetAccountDiskUsageCallback& callback) override {
+ DBusThreadManager::Get()->GetCryptohomeClient()->GetAccountDiskUsage(
+ id, base::Bind(&HomedirMethodsImpl::OnGetAccountDiskUsageCallback,
+ weak_ptr_factory_.GetWeakPtr(), callback));
+ }
+
private:
void OnGetKeyDataExCallback(const GetKeyDataCallback& callback,
chromeos::DBusMethodCallStatus call_status,
@@ -406,6 +414,30 @@ class HomedirMethodsImpl : public HomedirMethods {
callback.Run(true, MOUNT_ERROR_NONE, mount_hash);
}
+ void OnGetAccountDiskUsageCallback(
+ const GetAccountDiskUsageCallback& callback,
+ chromeos::DBusMethodCallStatus call_status,
+ bool result,
+ const BaseReply& reply) {
+ if (call_status != chromeos::DBUS_METHOD_CALL_SUCCESS) {
+ callback.Run(false, -1);
+ return;
+ }
+ if (reply.has_error()) {
+ if (reply.error() != CRYPTOHOME_ERROR_NOT_SET) {
+ callback.Run(false, -1);
+ return;
+ }
+ }
+ if (!reply.HasExtension(GetAccountDiskUsageReply::reply)) {
+ callback.Run(false, -1);
+ return;
+ }
+
+ int64_t size = reply.GetExtension(GetAccountDiskUsageReply::reply).size();
+ callback.Run(true, size);
+ }
+
void OnBaseReplyCallback(const Callback& callback,
chromeos::DBusMethodCallStatus call_status,
bool result,
« no previous file with comments | « chromeos/cryptohome/homedir_methods.h ('k') | chromeos/cryptohome/mock_homedir_methods.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698