Chromium Code Reviews| Index: chrome/browser/safe_browsing/chrome_cleaner/settings_resetter_win.cc |
| diff --git a/chrome/browser/safe_browsing/chrome_cleaner/settings_resetter_win.cc b/chrome/browser/safe_browsing/chrome_cleaner/settings_resetter_win.cc |
| index 3a8bb83f7ac8936ab0b7fbdf0f8d8d88b5fcbbef..f52d0d3aeab32142cd8716ca097ed4e932de0cdf 100644 |
| --- a/chrome/browser/safe_browsing/chrome_cleaner/settings_resetter_win.cc |
| +++ b/chrome/browser/safe_browsing/chrome_cleaner/settings_resetter_win.cc |
| @@ -96,6 +96,10 @@ class SettingsResetter : public base::RefCounted<SettingsResetter> { |
| // The profiles to be reset. |
| std::vector<Profile*> profiles_to_reset_; |
| + // The ProfileResetter objects that are used to reset each profile. We need to |
| + // hold on to these until each reset operation has been completed. |
| + std::vector<std::unique_ptr<ProfileResetter>> profile_resetters_; |
| + |
| // The number of profiles that need to be reset. |
| int num_pending_resets_; |
| @@ -140,7 +144,8 @@ void SettingsResetter::OnFetchCompleted( |
| ProfileResetter::EXTENSIONS | ProfileResetter::STARTUP_PAGES | |
| ProfileResetter::SHORTCUTS; |
| - delegate_->GetProfileResetter(profile)->Reset( |
| + profile_resetters_.push_back(delegate_->GetProfileResetter(profile)); |
| + profile_resetters_.back()->Reset( |
|
ftirelo
2017/06/22 11:04:39
Would it make sense to DCHECK that this always hap
alito
2017/06/22 17:44:11
Done.
|
| kSettingsToReset, std::move(master_settings), |
| base::Bind(&SettingsResetter::OnResetCompleted, this, profile)); |
| } |