From 47081c8eda313d8dabadadcfd09a4196802862a3 Mon Sep 17 00:00:00 2001 From: cmumford Date: Mon, 16 Nov 2015 10:20:43 -0800 Subject: Extensions: Checking for failure when reading settings from db. Previously SettingsStorageQuotaEnforcer::CalculateUsage() made one attempt to restore the db, but assumed that a second call to Get() would always return a valid settings dictionary. BUG=554657 Review URL: https://codereview.chromium.org/1434133002 Cr-Commit-Position: refs/heads/master@{#359866} --- extensions/browser/api/storage/settings_storage_quota_enforcer.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'extensions/browser/api/storage') diff --git a/extensions/browser/api/storage/settings_storage_quota_enforcer.cc b/extensions/browser/api/storage/settings_storage_quota_enforcer.cc index 1fbcbbd..09756d9 100644 --- a/extensions/browser/api/storage/settings_storage_quota_enforcer.cc +++ b/extensions/browser/api/storage/settings_storage_quota_enforcer.cc @@ -256,7 +256,9 @@ void SettingsStorageQuotaEnforcer::CalculateUsage() { if (maybe_settings->error().code == ValueStore::CORRUPTION && delegate_->Restore()) { maybe_settings = delegate_->Get(); - } else { + } + + if (maybe_settings->HasError()) { LOG(WARNING) << "Failed to get settings for quota:" << maybe_settings->error().message; return; -- cgit v1.1