diff options
author | mnissler@chromium.org <mnissler@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-27 09:39:39 +0000 |
---|---|---|
committer | mnissler@chromium.org <mnissler@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-27 09:39:39 +0000 |
commit | 909ace152b55c22937973cd3cf45380375e8eb4c (patch) | |
tree | 079996b1853f1a447a6b0f2eded50b7e99438fd5 /chrome/browser/chromeos | |
parent | 2bb442080efb93077593088028c89988e7cb145a (diff) | |
download | chromium_src-909ace152b55c22937973cd3cf45380375e8eb4c.zip chromium_src-909ace152b55c22937973cd3cf45380375e8eb4c.tar.gz chromium_src-909ace152b55c22937973cd3cf45380375e8eb4c.tar.bz2 |
Merge 144195 - Fix crash to bad authenticator profile on policy token fetch.
See the bug for the full story.
BUG=chromium:134488
TEST=See bug comment #6.
Review URL: https://chromiumcodereview.appspot.com/10662050
TBR=mnissler@chromium.org
Review URL: https://chromiumcodereview.appspot.com/10699004
git-svn-id: svn://svn.chromium.org/chrome/branches/1180/src@144427 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chromeos')
-rw-r--r-- | chrome/browser/chromeos/login/login_utils.cc | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/chrome/browser/chromeos/login/login_utils.cc b/chrome/browser/chromeos/login/login_utils.cc index 95c1a6c..59c76a9c 100644 --- a/chrome/browser/chromeos/login/login_utils.cc +++ b/chrome/browser/chromeos/login/login_utils.cc @@ -1023,10 +1023,13 @@ void LoginUtilsImpl::FetchPolicyToken(Profile* offrecord_profile, // Fetch dm service token now, if it hasn't been fetched yet. if (!policy_oauth_fetcher_.get() || policy_oauth_fetcher_->failed()) { // Get the default system profile to use with the policy fetching. If there - // is no |authenticator_|, manually load default system profile. Otherwise, - // just use |authenticator_|'s profile. + // is no |authenticator_| profile, manually load default system profile. + // Otherwise, just use |authenticator_|'s profile. Profile* profile = NULL; - if (!authenticator_) { + if (authenticator_) + profile = authenticator_->authentication_profile(); + + if (!profile) { FilePath user_data_dir; PathService::Get(chrome::DIR_USER_DATA, &user_data_dir); ProfileManager* profile_manager = g_browser_process->profile_manager(); @@ -1034,9 +1037,8 @@ void LoginUtilsImpl::FetchPolicyToken(Profile* offrecord_profile, base::ThreadRestrictions::ScopedAllowIO allow_io; profile = profile_manager->GetProfile(user_data_dir)-> GetOffTheRecordProfile(); - } else { - profile = authenticator_->authentication_profile(); } + // Trigger oauth token fetch for user policy. policy_oauth_fetcher_.reset(new PolicyOAuthFetcher(profile, token, secret)); policy_oauth_fetcher_->Start(); |