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

Unified Diff: chrome/browser/chromeos/login/user_manager_impl.cc

Issue 10382086: Determine whether user is ephemeral when coming back from a crash (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 7 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
Index: chrome/browser/chromeos/login/user_manager_impl.cc
diff --git a/chrome/browser/chromeos/login/user_manager_impl.cc b/chrome/browser/chromeos/login/user_manager_impl.cc
index 00fee5a577e97f8c4ce5f13465a73b3d6effca48..81c9a856069ad535a39dbeb3a96ed6ee63b3fcbf 100644
--- a/chrome/browser/chromeos/login/user_manager_impl.cc
+++ b/chrome/browser/chromeos/login/user_manager_impl.cc
@@ -888,6 +888,17 @@ bool UserManagerImpl::IsEphemeralUser(const std::string& email) const {
if (logged_in_user_ && (email == logged_in_user_->email()))
return is_current_user_ephemeral_;
+ // If the browser is coming back after a crash in the middle of a session, the
+ // user's cryptohome will already be mounted. When this is the case, the user
+ // is ephemeral iff the cryptohome was mounted as ephemeral.
+ bool is_mounted;
+ bool is_ephemeral_mount;
+ if (DBusThreadManager::Get()->GetCryptohomeClient()->
Nikita (slow) 2012/05/10 09:10:12 That doesn't seem like a correct solution i.e. alw
Nikita (slow) 2012/05/10 09:19:56 When Chrome is restarted after crash, UserManager:
bartfab (slow) 2012/05/10 09:21:44 Thanks. I was looking through the code just now to
+ IsMountedForUser(email, &is_mounted, &is_ephemeral_mount)) {
+ if (is_mounted)
+ return is_ephemeral_mount;
+ }
+
// Any other user is ephemeral iff ephemeral users are enabled, the user is
// not the owner and is not in the persistent list.
return AreEphemeralUsersEnabled() &&

Powered by Google App Engine
This is Rietveld 408576698