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

Side by Side Diff: chrome/browser/chromeos/login/user_manager.cc

Issue 8491043: Allow linker initialization of lazy instance (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: thakis comment, renamed LAZY_INSTANCE_INITIALIZER Created 9 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "chrome/browser/chromeos/login/user_manager.h" 5 #include "chrome/browser/chromeos/login/user_manager.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/file_path.h" 10 #include "base/file_path.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 const char kImagePathNodeName[] = "path"; 76 const char kImagePathNodeName[] = "path";
77 const char kImageIndexNodeName[] = "index"; 77 const char kImageIndexNodeName[] = "index";
78 78
79 // Index of the default image used as stub while the real user image is loading 79 // Index of the default image used as stub while the real user image is loading
80 // from file and for the |kStubUser| user. 80 // from file and for the |kStubUser| user.
81 const int kStubDefaultImageIndex = 0; 81 const int kStubDefaultImageIndex = 0;
82 82
83 // Delay betweeen user login and attempt to update user's profile image. 83 // Delay betweeen user login and attempt to update user's profile image.
84 const long kProfileImageDownloadDelayMs = 10000; 84 const long kProfileImageDownloadDelayMs = 10000;
85 85
86 base::LazyInstance<UserManager> g_user_manager(base::LINKER_INITIALIZED); 86 base::LazyInstance<UserManager> g_user_manager = LAZY_INSTANCE_INITIALIZER;
87 87
88 // Used to handle the asynchronous response of deleting a cryptohome directory. 88 // Used to handle the asynchronous response of deleting a cryptohome directory.
89 class RemoveAttempt : public CryptohomeLibrary::Delegate { 89 class RemoveAttempt : public CryptohomeLibrary::Delegate {
90 public: 90 public:
91 // Creates new remove attempt for the given user. Note, |delegate| can 91 // Creates new remove attempt for the given user. Note, |delegate| can
92 // be NULL. 92 // be NULL.
93 RemoveAttempt(const std::string& user_email, 93 RemoveAttempt(const std::string& user_email,
94 chromeos::RemoveUserDelegate* delegate) 94 chromeos::RemoveUserDelegate* delegate)
95 : user_email_(user_email), 95 : user_email_(user_email),
96 delegate_(delegate), 96 delegate_(delegate),
(...skipping 760 matching lines...) Expand 10 before | Expand all | Expand 10 after
857 857
858 User* UserManager::CreateUser(const std::string& email) const { 858 User* UserManager::CreateUser(const std::string& email) const {
859 User* user = new User(email); 859 User* user = new User(email);
860 user->set_oauth_token_status(GetUserOAuthStatus(email)); 860 user->set_oauth_token_status(GetUserOAuthStatus(email));
861 // Used to determine whether user's display name is unique. 861 // Used to determine whether user's display name is unique.
862 ++display_name_count_[user->GetDisplayName()]; 862 ++display_name_count_[user->GetDisplayName()];
863 return user; 863 return user;
864 } 864 }
865 865
866 } // namespace chromeos 866 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698