Commit 09404ce3 authored by derat@chromium.org's avatar derat@chromium.org

chromeos: Try to avoid LoginUtilsImpl delegate segfault.

This makes LoginUtilsImpl::OnProfileCreated() check that its
delegate is non-NULL before using it.  I'm hoping that this
will avoid a segfault that's apparently showing up during
testing when Chrome is killed during initialization.

Note that this is just a temporary workaround; the
underlying code is possibly still incorrect (or relying on
incorrect assumptions about the order in which things will
happen).

BUG=chromium-os:18269
TEST=none
TBR=altimofeev@chromium.org

Review URL: http://codereview.chromium.org/7590026

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@96208 0039d316-1c4b-4281-b951-d872f2087c98
parent 34b99fb0
...@@ -562,7 +562,14 @@ void LoginUtilsImpl::OnProfileCreated(Profile* user_profile, Status status) { ...@@ -562,7 +562,14 @@ void LoginUtilsImpl::OnProfileCreated(Profile* user_profile, Status status) {
user_profile->OnLogin(); user_profile->OnLogin();
delegate_->OnProfilePrepared(user_profile); // TODO(altimofeev): This pointer should probably never be NULL, but it looks
// like LoginUtilsImpl::OnProfileCreated() may be getting called before
// LoginUtilsImpl::PrepareProfile() has set |delegate_| when Chrome is killed
// during shutdown in tests -- see http://crosbug.com/18269. Replace this
// 'if' statement with a CHECK(delegate_) once the underlying issue is
// resolved.
if (delegate_)
delegate_->OnProfilePrepared(user_profile);
// TODO(altimofeev): Need to sanitize memory used to store password. // TODO(altimofeev): Need to sanitize memory used to store password.
credentials_ = GaiaAuthConsumer::ClientLoginResult(); credentials_ = GaiaAuthConsumer::ClientLoginResult();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment