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

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

Issue 1349783006: Cleanup: Pass std::string as const reference if possible (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert third_party changes Created 5 years, 3 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 "components/user_manager/user_manager_base.h" 5 #include "components/user_manager/user_manager_base.h"
6 6
7 #include <cstddef> 7 #include <cstddef>
8 #include <set> 8 #include <set>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 772 matching lines...) Expand 10 before | Expand all | Expand 10 after
783 } 783 }
784 784
785 void UserManagerBase::SetIsCurrentUserNew(bool is_new) { 785 void UserManagerBase::SetIsCurrentUserNew(bool is_new) {
786 is_current_user_new_ = is_new; 786 is_current_user_new_ = is_new;
787 } 787 }
788 788
789 bool UserManagerBase::HasPendingBootstrap(const std::string& user_id) const { 789 bool UserManagerBase::HasPendingBootstrap(const std::string& user_id) const {
790 return false; 790 return false;
791 } 791 }
792 792
793 void UserManagerBase::SetOwnerEmail(std::string owner_user_id) { 793 void UserManagerBase::SetOwnerEmail(const std::string& owner_user_id) {
794 owner_email_ = owner_user_id; 794 owner_email_ = owner_user_id;
795 } 795 }
796 796
797 const std::string& UserManagerBase::GetPendingUserSwitchID() const { 797 const std::string& UserManagerBase::GetPendingUserSwitchID() const {
798 return pending_user_switch_; 798 return pending_user_switch_;
799 } 799 }
800 800
801 void UserManagerBase::SetPendingUserSwitchID(std::string user_id) { 801 void UserManagerBase::SetPendingUserSwitchID(const std::string& user_id) {
802 pending_user_switch_ = user_id; 802 pending_user_switch_ = user_id;
803 } 803 }
804 804
805 void UserManagerBase::EnsureUsersLoaded() { 805 void UserManagerBase::EnsureUsersLoaded() {
806 DCHECK(task_runner_->RunsTasksOnCurrentThread()); 806 DCHECK(task_runner_->RunsTasksOnCurrentThread());
807 if (!GetLocalState()) 807 if (!GetLocalState())
808 return; 808 return;
809 809
810 if (user_loading_stage_ != STAGE_NOT_LOADED) 810 if (user_loading_stage_ != STAGE_NOT_LOADED)
811 return; 811 return;
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after
1346 } 1346 }
1347 1347
1348 void UserManagerBase::DeleteUser(User* user) { 1348 void UserManagerBase::DeleteUser(User* user) {
1349 const bool is_active_user = (user == active_user_); 1349 const bool is_active_user = (user == active_user_);
1350 delete user; 1350 delete user;
1351 if (is_active_user) 1351 if (is_active_user)
1352 active_user_ = NULL; 1352 active_user_ = NULL;
1353 } 1353 }
1354 1354
1355 } // namespace user_manager 1355 } // namespace user_manager
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698