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

Side by Side Diff: components/user_manager/user_manager_base.cc

Issue 2824343003: Fix deleting user account does not delete data (Closed)
Patch Set: 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "components/user_manager/user_manager_base.h" 5 #include "components/user_manager/user_manager_base.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <set> 8 #include <set>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 287
288 void UserManagerBase::RemoveUserInternal(const AccountId& account_id, 288 void UserManagerBase::RemoveUserInternal(const AccountId& account_id,
289 RemoveUserDelegate* delegate) { 289 RemoveUserDelegate* delegate) {
290 RemoveNonOwnerUserInternal(account_id, delegate); 290 RemoveNonOwnerUserInternal(account_id, delegate);
291 } 291 }
292 292
293 void UserManagerBase::RemoveNonOwnerUserInternal(const AccountId& account_id, 293 void UserManagerBase::RemoveNonOwnerUserInternal(const AccountId& account_id,
294 RemoveUserDelegate* delegate) { 294 RemoveUserDelegate* delegate) {
295 if (delegate) 295 if (delegate)
296 delegate->OnBeforeUserRemoved(account_id); 296 delegate->OnBeforeUserRemoved(account_id);
297 AsyncRemoveCryptohome(account_id);
297 RemoveUserFromList(account_id); 298 RemoveUserFromList(account_id);
298 AsyncRemoveCryptohome(account_id);
299 299
300 if (delegate) 300 if (delegate)
301 delegate->OnUserRemoved(account_id); 301 delegate->OnUserRemoved(account_id);
302 } 302 }
303 303
304 void UserManagerBase::RemoveUserFromList(const AccountId& account_id) { 304 void UserManagerBase::RemoveUserFromList(const AccountId& account_id) {
305 DCHECK(task_runner_->RunsTasksOnCurrentThread()); 305 DCHECK(task_runner_->RunsTasksOnCurrentThread());
306 RemoveNonCryptohomeData(account_id); 306 RemoveNonCryptohomeData(account_id);
307 if (user_loading_stage_ == STAGE_LOADED) { 307 if (user_loading_stage_ == STAGE_LOADED) {
308 DeleteUser(RemoveRegularOrSupervisedUserFromList(account_id)); 308 DeleteUser(RemoveRegularOrSupervisedUserFromList(account_id));
(...skipping 786 matching lines...) Expand 10 before | Expand all | Expand 10 after
1095 } 1095 }
1096 1096
1097 void UserManagerBase::DeleteUser(User* user) { 1097 void UserManagerBase::DeleteUser(User* user) {
1098 const bool is_active_user = (user == active_user_); 1098 const bool is_active_user = (user == active_user_);
1099 delete user; 1099 delete user;
1100 if (is_active_user) 1100 if (is_active_user)
1101 active_user_ = nullptr; 1101 active_user_ = nullptr;
1102 } 1102 }
1103 1103
1104 } // namespace user_manager 1104 } // namespace user_manager
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698