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

Unified Diff: components/user_manager/known_user.h

Issue 2711113003: Track whether a given user session has completed initialization, and use (Closed)
Patch Set: Only expose known_user::RemovePrefsForTesting() for tests Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/user_manager/fake_user_manager.cc ('k') | components/user_manager/known_user.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/user_manager/known_user.h
diff --git a/components/user_manager/known_user.h b/components/user_manager/known_user.h
index 245ed573f3872f388bda6525a0fbc0584b588c72..da26caaac53b13f468656a5d0cf3fd9c4494c11f 100644
--- a/components/user_manager/known_user.h
+++ b/components/user_manager/known_user.h
@@ -127,6 +127,17 @@ void USER_MANAGER_EXPORT UpdateUsingSAML(const AccountId& account_id,
// returns false.
bool USER_MANAGER_EXPORT IsUsingSAML(const AccountId& account_id);
+// Returns true if the user's session has already completed initialization
+// (set to false when session is created, and then is set to true once
+// the profile is intiaiized - this allows us to detect crashes/restarts during
+// initial session creation so we can recover gracefully).
+bool USER_MANAGER_EXPORT WasProfileEverInitialized(const AccountId& account_id);
+
+// Sets the flag that denotes whether the session associated with a user has
+// completed initialization at least once.
+void USER_MANAGER_EXPORT SetProfileEverInitialized(const AccountId& account_id,
+ bool initialized);
+
// Saves why the user has to go through re-auth flow.
void USER_MANAGER_EXPORT UpdateReauthReason(const AccountId& account_id,
const int reauth_reason);
@@ -138,8 +149,10 @@ bool USER_MANAGER_EXPORT FindReauthReason(const AccountId& account_id,
int* out_value);
// Removes all user preferences associated with |account_id|.
-// (This one used by user_manager only and thus not exported.)
+// Not exported as code should not be calling this outside this component
+// (with the exception of tests, so a test-only API is exposed).
void RemovePrefs(const AccountId& account_id);
+void USER_MANAGER_EXPORT RemovePrefsForTesting(const AccountId& account_id);
// Register known user prefs.
void USER_MANAGER_EXPORT RegisterPrefs(PrefRegistrySimple* registry);
« no previous file with comments | « components/user_manager/fake_user_manager.cc ('k') | components/user_manager/known_user.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698