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

Side by Side 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: fix tests 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/signin/easy_unlock_service_regular.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/signin/easy_unlock_service.h" 5 #include "chrome/browser/signin/easy_unlock_service.h"
6 6
7 #include "apps/app_lifetime_monitor.h" 7 #include "apps/app_lifetime_monitor.h"
8 #include "apps/app_lifetime_monitor_factory.h" 8 #include "apps/app_lifetime_monitor_factory.h"
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 486
487 return handler->state(); 487 return handler->state();
488 } 488 }
489 489
490 void EasyUnlockService::AttemptAuth(const std::string& user_id) { 490 void EasyUnlockService::AttemptAuth(const std::string& user_id) {
491 AttemptAuth(user_id, AttemptAuthCallback()); 491 AttemptAuth(user_id, AttemptAuthCallback());
492 } 492 }
493 493
494 void EasyUnlockService::AttemptAuth(const std::string& user_id, 494 void EasyUnlockService::AttemptAuth(const std::string& user_id,
495 const AttemptAuthCallback& callback) { 495 const AttemptAuthCallback& callback) {
496 CHECK_EQ(GetUserEmail(), user_id); 496 const std::string user_email = GetUserEmail();
497 if (user_email.empty()) {
498 LOG(ERROR) << "Empty user email. Refresh token might go bad.";
499 return;
Tim Song 2015/05/21 00:06:46 We should run the callback with a failure.
xiyuan 2015/05/21 01:32:12 Good call. Done.
500 }
501
502 CHECK_EQ(user_email, user_id);
497 503
498 auth_attempt_.reset(new EasyUnlockAuthAttempt( 504 auth_attempt_.reset(new EasyUnlockAuthAttempt(
499 app_manager_.get(), user_id, 505 app_manager_.get(), user_id,
500 GetType() == TYPE_REGULAR ? EasyUnlockAuthAttempt::TYPE_UNLOCK 506 GetType() == TYPE_REGULAR ? EasyUnlockAuthAttempt::TYPE_UNLOCK
501 : EasyUnlockAuthAttempt::TYPE_SIGNIN, 507 : EasyUnlockAuthAttempt::TYPE_SIGNIN,
502 callback)); 508 callback));
503 if (!auth_attempt_->Start()) 509 if (!auth_attempt_->Start())
504 auth_attempt_.reset(); 510 auth_attempt_.reset();
505 } 511 }
506 512
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
857 863
858 // TODO(tbarzic): Set check_private_key only if previous sign-in attempt 864 // TODO(tbarzic): Set check_private_key only if previous sign-in attempt
859 // failed. 865 // failed.
860 EasyUnlockTpmKeyManagerFactory::GetInstance()->Get(profile_) 866 EasyUnlockTpmKeyManagerFactory::GetInstance()->Get(profile_)
861 ->PrepareTpmKey(true /* check_private_key */, 867 ->PrepareTpmKey(true /* check_private_key */,
862 base::Closure()); 868 base::Closure());
863 #endif // defined(OS_CHROMEOS) 869 #endif // defined(OS_CHROMEOS)
864 870
865 tpm_key_checked_ = true; 871 tpm_key_checked_ = true;
866 } 872 }
OLDNEW
« 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