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

Unified Diff: chrome/browser/signin/easy_unlock_service.cc

Issue 1149873003: easy-unlock: Fix AttemptAuth email CHECK crash (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: run callback with failure Created 5 years, 7 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 | chrome/browser/signin/easy_unlock_service_regular.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/signin/easy_unlock_service.cc
diff --git a/chrome/browser/signin/easy_unlock_service.cc b/chrome/browser/signin/easy_unlock_service.cc
index 5170566ad18c2ff6abb703b2a691a760a590085c..0ed8275127bfef8744b7ef8db6b09910ad4a6a5d 100644
--- a/chrome/browser/signin/easy_unlock_service.cc
+++ b/chrome/browser/signin/easy_unlock_service.cc
@@ -493,13 +493,24 @@ void EasyUnlockService::AttemptAuth(const std::string& user_id) {
void EasyUnlockService::AttemptAuth(const std::string& user_id,
const AttemptAuthCallback& callback) {
+ const EasyUnlockAuthAttempt::Type auth_attempt_type =
+ GetType() == TYPE_REGULAR ? EasyUnlockAuthAttempt::TYPE_UNLOCK
+ : EasyUnlockAuthAttempt::TYPE_SIGNIN;
+ const std::string user_email = GetUserEmail();
+ if (user_email.empty()) {
+ LOG(ERROR) << "Empty user email. Refresh token might go bad.";
+ if (!callback.is_null()) {
+ const bool kFailure = false;
+ callback.Run(auth_attempt_type, kFailure, user_id, std::string(),
+ std::string());
+ }
+ return;
+ }
+
CHECK_EQ(GetUserEmail(), user_id);
- auth_attempt_.reset(new EasyUnlockAuthAttempt(
- app_manager_.get(), user_id,
- GetType() == TYPE_REGULAR ? EasyUnlockAuthAttempt::TYPE_UNLOCK
- : EasyUnlockAuthAttempt::TYPE_SIGNIN,
- callback));
+ auth_attempt_.reset(new EasyUnlockAuthAttempt(app_manager_.get(), user_id,
+ auth_attempt_type, callback));
if (!auth_attempt_->Start())
auth_attempt_.reset();
}
« no previous file with comments | « no previous file | chrome/browser/signin/easy_unlock_service_regular.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698