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

Unified Diff: chrome/browser/chromeos/login/signin/merge_session_throttling_utils.cc

Issue 2537263002: Prevent the pre-session-restore log spam (Closed)
Patch Set: Nit Created 4 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/signin/merge_session_throttling_utils.cc
diff --git a/chrome/browser/chromeos/login/signin/merge_session_throttling_utils.cc b/chrome/browser/chromeos/login/signin/merge_session_throttling_utils.cc
index 182474e4d2c0a3631a72f1f86e6c2589fb782b6d..edab4bdd1a568f944ed3f5731660449dde17fbfd 100644
--- a/chrome/browser/chromeos/login/signin/merge_session_throttling_utils.cc
+++ b/chrome/browser/chromeos/login/signin/merge_session_throttling_utils.cc
@@ -184,4 +184,27 @@ bool ShouldDelayUrl(const GURL& url) {
google_util::ALLOW_SUBDOMAIN);
}
+bool IsSessionRestorePending(Profile* profile) {
+ if (!profile)
+ return false;
Wez 2016/12/08 18:33:26 Is |false| the correct value in this case? What do
+
+ chromeos::OAuth2LoginManager* login_manager =
+ chromeos::OAuth2LoginManagerFactory::GetInstance()->GetForProfile(
+ profile);
+ bool pending_session_restore = false;
+ if (login_manager) {
+ switch (login_manager->state()) {
Wez 2016/12/08 18:33:26 nit: This would be easier to read as an if(), rath
+ case chromeos::OAuth2LoginManager::SESSION_RESTORE_PREPARING:
+ case chromeos::OAuth2LoginManager::SESSION_RESTORE_IN_PROGRESS:
+ pending_session_restore = true;
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ return pending_session_restore;
+}
+
} // namespace merge_session_throttling_utils
« no previous file with comments | « chrome/browser/chromeos/login/signin/merge_session_throttling_utils.h ('k') | chrome/browser/search/search.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698