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

Side by Side Diff: chrome/browser/chromeos/login/login_utils.cc

Issue 7590026: chromeos: Try to avoid LoginUtilsImpl delegate segfault. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add TODO Created 9 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/chromeos/login/login_utils.h" 5 #include "chrome/browser/chromeos/login/login_utils.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after
555 // done yet to pull down policies from the domain admin. We'll take this 555 // done yet to pull down policies from the domain admin. We'll take this
556 // out when we get that done properly. 556 // out when we get that done properly.
557 // TODO(xiyuan): Remove this once enterprise feature is ready. 557 // TODO(xiyuan): Remove this once enterprise feature is ready.
558 if (EndsWith(username_, "@google.com", true)) { 558 if (EndsWith(username_, "@google.com", true)) {
559 PrefService* pref_service = user_profile->GetPrefs(); 559 PrefService* pref_service = user_profile->GetPrefs();
560 pref_service->SetBoolean(prefs::kEnableScreenLock, true); 560 pref_service->SetBoolean(prefs::kEnableScreenLock, true);
561 } 561 }
562 562
563 user_profile->OnLogin(); 563 user_profile->OnLogin();
564 564
565 delegate_->OnProfilePrepared(user_profile); 565 // TODO(altimofeev): This pointer should probably never be NULL, but it looks
566 // like LoginUtilsImpl::OnProfileCreated() may be getting called before
567 // LoginUtilsImpl::PrepareProfile() has set |delegate_| when Chrome is killed
altimofeev 2011/08/10 20:12:42 Actually, only LoginUtilsImpl:: PrepareProflie doe
568 // during shutdown in tests -- see http://crosbug.com/18269. Replace this
569 // 'if' statement with a CHECK(delegate_) once the underlying issue is
570 // resolved.
571 if (delegate_)
572 delegate_->OnProfilePrepared(user_profile);
566 573
567 // TODO(altimofeev): Need to sanitize memory used to store password. 574 // TODO(altimofeev): Need to sanitize memory used to store password.
568 credentials_ = GaiaAuthConsumer::ClientLoginResult(); 575 credentials_ = GaiaAuthConsumer::ClientLoginResult();
569 } 576 }
570 577
571 void LoginUtilsImpl::FetchOAuth1AccessToken(Profile* auth_profile) { 578 void LoginUtilsImpl::FetchOAuth1AccessToken(Profile* auth_profile) {
572 oauth_fetcher_.reset(new GaiaOAuthFetcher(this, 579 oauth_fetcher_.reset(new GaiaOAuthFetcher(this,
573 auth_profile->GetRequestContext(), 580 auth_profile->GetRequestContext(),
574 auth_profile, 581 auth_profile,
575 kServiceScopeChromeOS)); 582 kServiceScopeChromeOS));
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
978 // Mark login host for deletion after browser starts. This 985 // Mark login host for deletion after browser starts. This
979 // guarantees that the message loop will be referenced by the 986 // guarantees that the message loop will be referenced by the
980 // browser before it is dereferenced by the login host. 987 // browser before it is dereferenced by the login host.
981 if (login_host) { 988 if (login_host) {
982 login_host->OnSessionStart(); 989 login_host->OnSessionStart();
983 login_host = NULL; 990 login_host = NULL;
984 } 991 }
985 } 992 }
986 993
987 } // namespace chromeos 994 } // namespace chromeos
OLDNEW
« 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