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

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

Issue 12207024: Crash fix for calling LoginUtilsImpl::RestoreAuthSession() during the main loop shutdown. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 4ac26e3c9f1b5f638e6e0d0fad4311aaf185fb46..ed5741ae3c975e7a852281a274e749ed9c1ff57b 100644
--- a/chrome/browser/chromeos/login/login_utils.cc
+++ b/chrome/browser/chromeos/login/login_utils.cc
@@ -544,13 +544,17 @@ void LoginUtilsImpl::CompleteProfileCreate(Profile* user_profile) {
void LoginUtilsImpl::RestoreAuthSession(Profile* user_profile,
bool restore_from_auth_cookies) {
- DCHECK(authenticator_ || !restore_from_auth_cookies);
+ CHECK((authenticator_ && authenticator_->authentication_profile()) ||
+ !restore_from_auth_cookies);
+ if (!login_manager_.get())
+ return;
+
// Remove legacy OAuth1 token if we have one. If it's valid, we should already
// have OAuth2 refresh token in TokenService that could be used to retrieve
// all other tokens and credentials.
login_manager_->RestoreSession(
user_profile,
- authenticator_ ?
+ authenticator_ && authenticator_->authentication_profile() ?
authenticator_->authentication_profile()->GetRequestContext() :
NULL,
restore_from_auth_cookies);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698