diff options
author | skobes@chromium.org <skobes@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-29 18:27:06 +0000 |
---|---|---|
committer | skobes@chromium.org <skobes@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-29 18:27:06 +0000 |
commit | d79b6fe0088357db47dd5f09b62776ade84a8362 (patch) | |
tree | 4fdc287cfa8d0bda9e8669b32366d84a8b9a07fb /components/session_manager/core | |
parent | dd1c2a75d2dacd95526ec21ab765098fd931def8 (diff) | |
download | chromium_src-d79b6fe0088357db47dd5f09b62776ade84a8362.zip chromium_src-d79b6fe0088357db47dd5f09b62776ade84a8362.tar.gz chromium_src-d79b6fe0088357db47dd5f09b62776ade84a8362.tar.bz2 |
Revert 286187 "user_manager component: Add UserManagerBase class."
Breaks PreferencesTest.MultiProfiles:
http://build.chromium.org/p/chromium.memory/builders/Linux%20Chromium%20OS%20ASan%20LSan%20Tests%20%281%29/builds/2299
[311:311:0729/081921:FATAL:user_manager.cc(69)] Check failed: g_user_manager.
> user_manager component: Add UserManagerBase class.
>
> UserManagerBase contains common methods extracted from UserManagerImpl.
> UserManagerImpl was renamed to ChromeUserManager and inherits UserManagerBase.
>
> Misc refactoring:
> * Move HasBrowserStarted() to SessionManager
> * Add generic getter SessionManager::Get() which makes it possible for concrete clients don't depend on instance ownership like g_browser_process->platform_part()->SessionManager().
> * Moved CRLSet code out of UserManager::UserLoggedIn(), to UserSessionManager.
>
> BUG=387614
>
> Review URL: https://codereview.chromium.org/417623002
TBR=nkostylev@chromium.org
Review URL: https://codereview.chromium.org/424193002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@286263 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'components/session_manager/core')
-rw-r--r-- | components/session_manager/core/session_manager.cc | 34 | ||||
-rw-r--r-- | components/session_manager/core/session_manager.h | 18 |
2 files changed, 0 insertions, 52 deletions
diff --git a/components/session_manager/core/session_manager.cc b/components/session_manager/core/session_manager.cc index f86de43..3fff748 100644 --- a/components/session_manager/core/session_manager.cc +++ b/components/session_manager/core/session_manager.cc @@ -6,30 +6,12 @@ #include "base/logging.h" -#if defined(OS_CHROMEOS) -#include "base/command_line.h" -#include "base/sys_info.h" -#include "chromeos/chromeos_switches.h" -#endif - namespace session_manager { -// static -SessionManager* SessionManager::instance = NULL; - SessionManager::SessionManager() : session_state_(SESSION_STATE_UNKNOWN) { - DCHECK(!SessionManager::Get()); - SessionManager::SetInstance(this); } SessionManager::~SessionManager() { - DCHECK(instance == this); - SessionManager::SetInstance(NULL); -} - -// static -SessionManager* SessionManager::Get() { - return SessionManager::instance; } void SessionManager::SetSessionState(SessionState state) { @@ -49,26 +31,10 @@ void SessionManager::Initialize(SessionManagerDelegate* delegate) { delegate_->SetSessionManager(this); } -// static -void SessionManager::SetInstance(SessionManager* session_manager) { - SessionManager::instance = session_manager; -} - void SessionManager::Start() { delegate_->Start(); } -// static -bool SessionManager::HasBrowserRestarted() { -#if defined(OS_CHROMEOS) - CommandLine* command_line = CommandLine::ForCurrentProcess(); - return base::SysInfo::IsRunningOnChromeOS() && - command_line->HasSwitch(chromeos::switches::kLoginUser); -#else - return false; -#endif -} - SessionManagerDelegate::SessionManagerDelegate() : session_manager_(NULL) { } diff --git a/components/session_manager/core/session_manager.h b/components/session_manager/core/session_manager.h index d2e9704..e728e7f 100644 --- a/components/session_manager/core/session_manager.h +++ b/components/session_manager/core/session_manager.h @@ -45,10 +45,6 @@ class SESSION_EXPORT SessionManager { SessionManager(); virtual ~SessionManager(); - // Returns current SessionManager instance and NULL if it hasn't been - // initialized yet. - static SessionManager* Get(); - SessionState session_state() const { return session_state_; } virtual void SetSessionState(SessionState state); @@ -56,25 +52,11 @@ class SESSION_EXPORT SessionManager { // current session type / state. void Start(); - // Returns true when the browser has crashed and restarted during the current - // user's session. - static bool HasBrowserRestarted(); - protected: // Initializes SessionManager with delegate. void Initialize(SessionManagerDelegate* delegate); - // Sets SessionManager instance. - static void SetInstance(SessionManager* session_manager); - private: - // Pointer to the existing SessionManager instance (if any). - // Set in ctor, reset in dtor. Not owned since specific implementation of - // SessionManager should decide on its own appropriate owner of SessionManager - // instance. For src/chrome implementation such place is - // g_browser_process->platform_part(). - static SessionManager* instance; - SessionState session_state_; scoped_ptr<SessionManagerDelegate> delegate_; |