| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/cryptohome/homedir_methods.h" | 5 #include "chromeos/cryptohome/homedir_methods.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 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 FillAuthorizationProtobuf(auth, &auth_proto); | 271 FillAuthorizationProtobuf(auth, &auth_proto); |
| 272 FillKeyProtobuf(new_key, pb_update_key.mutable_changes()); | 272 FillKeyProtobuf(new_key, pb_update_key.mutable_changes()); |
| 273 pb_update_key.set_authorization_signature(signature); | 273 pb_update_key.set_authorization_signature(signature); |
| 274 | 274 |
| 275 DBusThreadManager::Get()->GetCryptohomeClient()->UpdateKeyEx( | 275 DBusThreadManager::Get()->GetCryptohomeClient()->UpdateKeyEx( |
| 276 id, auth_proto, pb_update_key, | 276 id, auth_proto, pb_update_key, |
| 277 base::Bind(&HomedirMethodsImpl::OnBaseReplyCallback, | 277 base::Bind(&HomedirMethodsImpl::OnBaseReplyCallback, |
| 278 weak_ptr_factory_.GetWeakPtr(), callback)); | 278 weak_ptr_factory_.GetWeakPtr(), callback)); |
| 279 } | 279 } |
| 280 | 280 |
| 281 void RenameCryptohome(const Identification& id_from, |
| 282 const Identification& id_to, |
| 283 const Callback& callback) override { |
| 284 DBusThreadManager::Get()->GetCryptohomeClient()->RenameCryptohome( |
| 285 id_from, id_to, base::Bind(&HomedirMethodsImpl::OnBaseReplyCallback, |
| 286 weak_ptr_factory_.GetWeakPtr(), callback)); |
| 287 } |
| 288 |
| 281 private: | 289 private: |
| 282 void OnGetKeyDataExCallback(const GetKeyDataCallback& callback, | 290 void OnGetKeyDataExCallback(const GetKeyDataCallback& callback, |
| 283 chromeos::DBusMethodCallStatus call_status, | 291 chromeos::DBusMethodCallStatus call_status, |
| 284 bool result, | 292 bool result, |
| 285 const BaseReply& reply) { | 293 const BaseReply& reply) { |
| 286 if (call_status != chromeos::DBUS_METHOD_CALL_SUCCESS) { | 294 if (call_status != chromeos::DBUS_METHOD_CALL_SUCCESS) { |
| 287 callback.Run(false, MOUNT_ERROR_FATAL, std::vector<KeyDefinition>()); | 295 callback.Run(false, MOUNT_ERROR_FATAL, std::vector<KeyDefinition>()); |
| 288 return; | 296 return; |
| 289 } | 297 } |
| 290 if (reply.has_error()) { | 298 if (reply.has_error()) { |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 450 } | 458 } |
| 451 delete g_homedir_methods; | 459 delete g_homedir_methods; |
| 452 g_homedir_methods = NULL; | 460 g_homedir_methods = NULL; |
| 453 VLOG(1) << "HomedirMethods Shutdown completed"; | 461 VLOG(1) << "HomedirMethods Shutdown completed"; |
| 454 } | 462 } |
| 455 | 463 |
| 456 // static | 464 // static |
| 457 HomedirMethods* HomedirMethods::GetInstance() { return g_homedir_methods; } | 465 HomedirMethods* HomedirMethods::GetInstance() { return g_homedir_methods; } |
| 458 | 466 |
| 459 } // namespace cryptohome | 467 } // namespace cryptohome |
| OLD | NEW |