OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chromeos/dbus/cryptohome_client.h" | 5 #include "chromeos/dbus/cryptohome_client.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 | 146 |
147 dbus::MessageWriter writer(&method_call); | 147 dbus::MessageWriter writer(&method_call); |
148 writer.AppendProtoAsArrayOfBytes(id_from_proto); | 148 writer.AppendProtoAsArrayOfBytes(id_from_proto); |
149 writer.AppendProtoAsArrayOfBytes(id_to_proto); | 149 writer.AppendProtoAsArrayOfBytes(id_to_proto); |
150 proxy_->CallMethod(&method_call, kTpmDBusTimeoutMs, | 150 proxy_->CallMethod(&method_call, kTpmDBusTimeoutMs, |
151 base::Bind(&CryptohomeClientImpl::OnBaseReplyMethod, | 151 base::Bind(&CryptohomeClientImpl::OnBaseReplyMethod, |
152 weak_ptr_factory_.GetWeakPtr(), callback)); | 152 weak_ptr_factory_.GetWeakPtr(), callback)); |
153 } | 153 } |
154 | 154 |
155 // CryptohomeClient override. | 155 // CryptohomeClient override. |
| 156 void GetAccountDiskUsage(const cryptohome::Identification& account_id, |
| 157 const ProtobufMethodCallback& callback) override { |
| 158 dbus::MethodCall method_call(cryptohome::kCryptohomeInterface, |
| 159 cryptohome::kCryptohomeGetAccountDiskUsage); |
| 160 cryptohome::AccountIdentifier id; |
| 161 FillIdentificationProtobuf(account_id, &id); |
| 162 |
| 163 dbus::MessageWriter writer(&method_call); |
| 164 writer.AppendProtoAsArrayOfBytes(id); |
| 165 proxy_->CallMethod(&method_call, kTpmDBusTimeoutMs, |
| 166 base::Bind(&CryptohomeClientImpl::OnBaseReplyMethod, |
| 167 weak_ptr_factory_.GetWeakPtr(), callback)); |
| 168 } |
| 169 |
| 170 // CryptohomeClient override. |
156 void GetSystemSalt(const GetSystemSaltCallback& callback) override { | 171 void GetSystemSalt(const GetSystemSaltCallback& callback) override { |
157 dbus::MethodCall method_call(cryptohome::kCryptohomeInterface, | 172 dbus::MethodCall method_call(cryptohome::kCryptohomeInterface, |
158 cryptohome::kCryptohomeGetSystemSalt); | 173 cryptohome::kCryptohomeGetSystemSalt); |
159 proxy_->CallMethod(&method_call, kTpmDBusTimeoutMs , | 174 proxy_->CallMethod(&method_call, kTpmDBusTimeoutMs , |
160 base::Bind(&CryptohomeClientImpl::OnGetSystemSalt, | 175 base::Bind(&CryptohomeClientImpl::OnGetSystemSalt, |
161 weak_ptr_factory_.GetWeakPtr(), | 176 weak_ptr_factory_.GetWeakPtr(), |
162 callback)); | 177 callback)); |
163 } | 178 } |
164 | 179 |
165 // CryptohomeClient override, | 180 // CryptohomeClient override, |
(...skipping 1041 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1207 return new CryptohomeClientImpl(); | 1222 return new CryptohomeClientImpl(); |
1208 } | 1223 } |
1209 | 1224 |
1210 // static | 1225 // static |
1211 std::string CryptohomeClient::GetStubSanitizedUsername( | 1226 std::string CryptohomeClient::GetStubSanitizedUsername( |
1212 const cryptohome::Identification& cryptohome_id) { | 1227 const cryptohome::Identification& cryptohome_id) { |
1213 return cryptohome_id.id() + kUserIdStubHashSuffix; | 1228 return cryptohome_id.id() + kUserIdStubHashSuffix; |
1214 } | 1229 } |
1215 | 1230 |
1216 } // namespace chromeos | 1231 } // namespace chromeos |
OLD | NEW |