0
Files
src/components/session_manager
Hidehiko Abe 3cf7c876cd Remove unused params from UserManager::UserLoggedIn.
Also, some calls of UserManager::UserLoggedIn pass User::username_hash().
However, in production, UserLoggedIn sets the value to
User::username_hash so it was wrong. This CL fixes them, in most cases,
by using user_manager::TestHelper::GetFakeUsernameHash().

BUG=278643115
TEST=Tryjob

Change-Id: Id03ea14853c9b063c5fe6a72d8650ab2ba8bf4ba
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6357613
Reviewed-by: Xiyuan Xia <xiyuan@chromium.org>
Reviewed-by: Steven Bennetts <stevenjb@chromium.org>
Commit-Queue: Hidehiko Abe <hidehiko@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1433652}
2025-03-17 11:14:09 -07:00
..

SessionManager

This directory contains files for managing ChromeOS user sessions. It is a continuing effort to move the user session related code from UserManager and UserSessionManager to this directory.

It is put under components/ directory so that non-browser code could access it. However, ash/ code should access user sessions via ash::SessionController rather than this. SessionController/Client internally calls code here but it provides a separation of ash and browser. It would be nice to keep it.

The core/ directory contains the SessionManager class. It provides an interface to create user sessions, add/remove observers, and check user session state. User session managing methods are not ready for external code to use. They are still expected to be called from the current user session starting code path, i.e. UserSessionManager and ChromeSessionManager.

SessionManager::Get() method gets the singleton like instance. The instance in Chrome browser is ChromeSessionManager derived from SessionManager. This is needed because SessionManager logic depends on policy code which is still part of the browser. ChromeSessionManager is in browser/ and can access that. The ChromeSessionManager instance is created in the PreCreateMainMessageLoop stage and destroyed in the PostMainMessageLoopRun.