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

Side by Side Diff: chromeos/cryptohome/homedir_methods.cc

Issue 2748743004: cryptohome: Add dbus method and signal name for encryption migration. (Closed)
Patch Set: Created 3 years, 9 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 unified diff | Download patch
OLDNEW
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 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 } 291 }
292 292
293 void GetAccountDiskUsage( 293 void GetAccountDiskUsage(
294 const Identification& id, 294 const Identification& id,
295 const GetAccountDiskUsageCallback& callback) override { 295 const GetAccountDiskUsageCallback& callback) override {
296 DBusThreadManager::Get()->GetCryptohomeClient()->GetAccountDiskUsage( 296 DBusThreadManager::Get()->GetCryptohomeClient()->GetAccountDiskUsage(
297 id, base::Bind(&HomedirMethodsImpl::OnGetAccountDiskUsageCallback, 297 id, base::Bind(&HomedirMethodsImpl::OnGetAccountDiskUsageCallback,
298 weak_ptr_factory_.GetWeakPtr(), callback)); 298 weak_ptr_factory_.GetWeakPtr(), callback));
299 } 299 }
300 300
301 void MigrateToDircrypto(const Identification& id,
302 const Authorization& auth,
303 const Callback& callback) override {
304 cryptohome::AuthorizationRequest auth_proto;
305 FillAuthorizationProtobuf(auth, &auth_proto);
306
307 DBusThreadManager::Get()->GetCryptohomeClient()->MigrateToDircrypto(
308 id, auth_proto,
309 base::Bind(&HomedirMethodsImpl::OnBaseReplyCallback,
310 weak_ptr_factory_.GetWeakPtr(), callback));
311 }
312
301 private: 313 private:
302 void OnGetKeyDataExCallback(const GetKeyDataCallback& callback, 314 void OnGetKeyDataExCallback(const GetKeyDataCallback& callback,
303 chromeos::DBusMethodCallStatus call_status, 315 chromeos::DBusMethodCallStatus call_status,
304 bool result, 316 bool result,
305 const BaseReply& reply) { 317 const BaseReply& reply) {
306 if (call_status != chromeos::DBUS_METHOD_CALL_SUCCESS) { 318 if (call_status != chromeos::DBUS_METHOD_CALL_SUCCESS) {
307 callback.Run(false, MOUNT_ERROR_FATAL, std::vector<KeyDefinition>()); 319 callback.Run(false, MOUNT_ERROR_FATAL, std::vector<KeyDefinition>());
308 return; 320 return;
309 } 321 }
310 if (reply.has_error()) { 322 if (reply.has_error()) {
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
494 } 506 }
495 delete g_homedir_methods; 507 delete g_homedir_methods;
496 g_homedir_methods = NULL; 508 g_homedir_methods = NULL;
497 VLOG(1) << "HomedirMethods Shutdown completed"; 509 VLOG(1) << "HomedirMethods Shutdown completed";
498 } 510 }
499 511
500 // static 512 // static
501 HomedirMethods* HomedirMethods::GetInstance() { return g_homedir_methods; } 513 HomedirMethods* HomedirMethods::GetInstance() { return g_homedir_methods; }
502 514
503 } // namespace cryptohome 515 } // namespace cryptohome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698