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

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

Issue 5711001: Add a new GetInstance() method for remaining files with singleton classes under chrome/browser. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 10 years 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/login_utils.cc
diff --git a/chrome/browser/chromeos/login/login_utils.cc b/chrome/browser/chromeos/login/login_utils.cc
index ad8da19133e170798d0bb0f04218bb1e029fe6a5..11df756ca1e35950f18e2b6dcc17e0c1100c674e 100644
--- a/chrome/browser/chromeos/login/login_utils.cc
+++ b/chrome/browser/chromeos/login/login_utils.cc
@@ -143,7 +143,9 @@ class LoginUtilsImpl : public LoginUtils {
class LoginUtilsWrapper {
public:
- LoginUtilsWrapper() {}
+ static LoginUtilsWrapper* GetInstance() {
+ return Singleton<LoginUtilsWrapper>::get();
+ }
LoginUtils* get() {
AutoLock create(create_lock_);
@@ -157,6 +159,10 @@ class LoginUtilsWrapper {
}
private:
+ friend struct DefaultSingletonTraits<LoginUtilsWrapper>;
+
+ LoginUtilsWrapper() {}
+
Lock create_lock_;
scoped_ptr<LoginUtils> ptr_;
@@ -454,11 +460,11 @@ void LoginUtilsImpl::PrewarmAuthentication() {
}
LoginUtils* LoginUtils::Get() {
- return Singleton<LoginUtilsWrapper>::get()->get();
+ return LoginUtilsWrapper::GetInstance()->get();
}
void LoginUtils::Set(LoginUtils* mock) {
- Singleton<LoginUtilsWrapper>::get()->reset(mock);
+ LoginUtilsWrapper::GetInstance()->reset(mock);
}
void LoginUtils::DoBrowserLaunch(Profile* profile) {

Powered by Google App Engine
This is Rietveld 408576698