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

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

Issue 2818393002: cros: Mount the existing eCryptfs vault to start migration. (Closed)
Patch Set: FakeCryptohomeClient::MountEx should succeed when |to_migrate_from_ecryptfs| is true. Created 3 years, 8 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 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 215
216 if (!request.create_keys.empty()) { 216 if (!request.create_keys.empty()) {
217 CreateRequest* create = request_proto.mutable_create(); 217 CreateRequest* create = request_proto.mutable_create();
218 for (size_t i = 0; i < request.create_keys.size(); ++i) 218 for (size_t i = 0; i < request.create_keys.size(); ++i)
219 FillKeyProtobuf(request.create_keys[i], create->add_keys()); 219 FillKeyProtobuf(request.create_keys[i], create->add_keys());
220 } 220 }
221 221
222 if (request.force_dircrypto_if_available) 222 if (request.force_dircrypto_if_available)
223 request_proto.set_force_dircrypto_if_available(true); 223 request_proto.set_force_dircrypto_if_available(true);
224 224
225 if (request.to_migrate_from_ecryptfs)
226 request_proto.set_to_migrate_from_ecryptfs(true);
227
225 DBusThreadManager::Get()->GetCryptohomeClient()->MountEx( 228 DBusThreadManager::Get()->GetCryptohomeClient()->MountEx(
226 id, auth_proto, request_proto, 229 id, auth_proto, request_proto,
227 base::Bind(&HomedirMethodsImpl::OnMountExCallback, 230 base::Bind(&HomedirMethodsImpl::OnMountExCallback,
228 weak_ptr_factory_.GetWeakPtr(), callback)); 231 weak_ptr_factory_.GetWeakPtr(), callback));
229 } 232 }
230 233
231 void AddKeyEx(const Identification& id, 234 void AddKeyEx(const Identification& id,
232 const Authorization& auth, 235 const Authorization& auth,
233 const KeyDefinition& new_key, 236 const KeyDefinition& new_key,
234 bool clobber_if_exists, 237 bool clobber_if_exists,
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
509 } 512 }
510 delete g_homedir_methods; 513 delete g_homedir_methods;
511 g_homedir_methods = NULL; 514 g_homedir_methods = NULL;
512 VLOG(1) << "HomedirMethods Shutdown completed"; 515 VLOG(1) << "HomedirMethods Shutdown completed";
513 } 516 }
514 517
515 // static 518 // static
516 HomedirMethods* HomedirMethods::GetInstance() { return g_homedir_methods; } 519 HomedirMethods* HomedirMethods::GetInstance() { return g_homedir_methods; }
517 520
518 } // namespace cryptohome 521 } // namespace cryptohome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698