diff options
author | shashishekhar@chromium.org <shashishekhar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-10 02:29:37 +0000 |
---|---|---|
committer | shashishekhar@chromium.org <shashishekhar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-10 02:29:37 +0000 |
commit | 6db9f9944c1c0961f37507f619b0abeb20494e9e (patch) | |
tree | 39c6224b2f9a8da09edc6c068dec6d1a88608872 | |
parent | 29b12f410f51e864ad96f10297a8d46e7fb50561 (diff) | |
download | chromium_src-6db9f9944c1c0961f37507f619b0abeb20494e9e.zip chromium_src-6db9f9944c1c0961f37507f619b0abeb20494e9e.tar.gz chromium_src-6db9f9944c1c0961f37507f619b0abeb20494e9e.tar.bz2 |
Fix crash when user switches account from a passphrase account.
NotifyPassphraseAccepted can be called even before backend is
initialized. Android tries to check if cryptographer is ready when
passphrase is accepted. This can lead to a crash when backend is not
initialized. Fix is to check cryptographer only when backend is
ready.
BUG=223312, 196518
Review URL: https://chromiumcodereview.appspot.com/13640008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@193297 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/sync/profile_sync_service.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/chrome/browser/sync/profile_sync_service.cc b/chrome/browser/sync/profile_sync_service.cc index fd49215..a7265eb 100644 --- a/chrome/browser/sync/profile_sync_service.cc +++ b/chrome/browser/sync/profile_sync_service.cc @@ -199,6 +199,10 @@ bool ProfileSyncService::ShouldEnablePasswordSyncForAndroid() const { sync_prefs_.GetPreferredDataTypes(registered_types); if (!preferred_types.Has(syncer::PASSWORDS)) return false; + // If backend has not completed initializing we cannot check if the + // cryptographer is ready. + if (!sync_initialized()) + return false; // On Android we do not want to prompt user to enter a passphrase. If // passwords cannot be decrypted we just disable them. syncer::ReadTransaction trans(FROM_HERE, GetUserShare()); @@ -716,6 +720,8 @@ void ProfileSyncService::NotifyObservers() { void ProfileSyncService::ClearStaleErrors() { ClearUnrecoverableError(); last_actionable_error_ = SyncProtocolError(); + // Clear the data type errors as well. + failed_datatypes_handler_.OnUserChoseDatatypes(); } void ProfileSyncService::ClearUnrecoverableError() { |