Commit e73aed9a authored by Evan Stade's avatar Evan Stade Committed by Commit Bot

Fix shutdown crash in ProfileManager.

OnProfileMarkedForPermanentDeletion should move from
ProfileManagerObserver to ProfileObserver, which would also
fix this bug. However, changing the order of members is the
quickest and most cherry-pick-able way to avoid the crash.

Bug: 1005244
Change-Id: If2db68c846dd418cd02864b57b9b543687fa1e03
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1863518
Auto-Submit: Evan Stade <estade@chromium.org>
Reviewed-by: default avatarDavid Roger <droger@chromium.org>
Commit-Queue: Evan Stade <estade@chromium.org>
Cr-Commit-Position: refs/heads/master@{#706467}
parent d74c8dbc
...@@ -410,6 +410,10 @@ class ProfileManager : public content::NotificationObserver, ...@@ -410,6 +410,10 @@ class ProfileManager : public content::NotificationObserver,
const base::FilePath& profile_dir); const base::FilePath& profile_dir);
#endif // !defined(OS_ANDROID) #endif // !defined(OS_ANDROID)
// Destroy after |profile_info_cache_| since Profile destruction may trigger
// some observers to unregister themselves.
base::ObserverList<ProfileManagerObserver> observers_;
// Object to cache various information about profiles. Contains information // Object to cache various information about profiles. Contains information
// about every profile which has been created for this instance of Chrome, // about every profile which has been created for this instance of Chrome,
// if it has not been explicitly deleted. It must be destroyed after // if it has not been explicitly deleted. It must be destroyed after
...@@ -451,8 +455,6 @@ class ProfileManager : public content::NotificationObserver, ...@@ -451,8 +455,6 @@ class ProfileManager : public content::NotificationObserver,
// Controls whether to initialize some services. Only disabled for testing. // Controls whether to initialize some services. Only disabled for testing.
bool do_final_services_init_ = true; bool do_final_services_init_ = true;
base::ObserverList<ProfileManagerObserver> observers_;
// TODO(chrome/browser/profiles/OWNERS): Usage of this in profile_manager.cc // TODO(chrome/browser/profiles/OWNERS): Usage of this in profile_manager.cc
// should likely be turned into DCHECK_CURRENTLY_ON(BrowserThread::UI) for // should likely be turned into DCHECK_CURRENTLY_ON(BrowserThread::UI) for
// consistency with surrounding code in the same file but that wasn't trivial // consistency with surrounding code in the same file but that wasn't trivial
......
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