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

Unified Diff: chrome/browser/safe_browsing/settings_reset_prompt/settings_reset_prompt_model.cc

Issue 2852883002: Settings reset prompt: Fix crash when fetching default settings. (Closed)
Patch Set: Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/safe_browsing/settings_reset_prompt/settings_reset_prompt_model.cc
diff --git a/chrome/browser/safe_browsing/settings_reset_prompt/settings_reset_prompt_model.cc b/chrome/browser/safe_browsing/settings_reset_prompt/settings_reset_prompt_model.cc
index dbac8e3dac65b0b136404ab98611cdc457a0dbef..f93e81e6cb54a1115ffcfbc35e4faaf84fc7f79e 100644
--- a/chrome/browser/safe_browsing/settings_reset_prompt/settings_reset_prompt_model.cc
+++ b/chrome/browser/safe_browsing/settings_reset_prompt/settings_reset_prompt_model.cc
@@ -136,7 +136,13 @@ void DefaultSettingsFetcher::OnSettingsFetched() {
DCHECK(config_fetcher_);
DCHECK(!config_fetcher_->IsActive());
- PostCallbackAndDeleteSelf(config_fetcher_->GetSettings());
+ std::unique_ptr<BrandcodedDefaultSettings> settings(
+ config_fetcher_->GetSettings());
+ // Use default settings if fetching of BrandcodedDefaultSettings fails.
+ if (!settings)
+ settings.reset(new BrandcodedDefaultSettings());
+
+ PostCallbackAndDeleteSelf(std::move(settings));
}
void DefaultSettingsFetcher::PostCallbackAndDeleteSelf(
« 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