diff options
author | cmumford <cmumford@chromium.org> | 2015-11-16 10:20:43 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-11-16 18:21:45 +0000 |
commit | 47081c8eda313d8dabadadcfd09a4196802862a3 (patch) | |
tree | 9118d83b966455eb5b7c0373925d2fad2c6d9133 /extensions/browser/api/storage | |
parent | c3dcc79c556f87330d18703b538962c0d4c0a7e4 (diff) | |
download | chromium_src-47081c8eda313d8dabadadcfd09a4196802862a3.zip chromium_src-47081c8eda313d8dabadadcfd09a4196802862a3.tar.gz chromium_src-47081c8eda313d8dabadadcfd09a4196802862a3.tar.bz2 |
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}
Diffstat (limited to 'extensions/browser/api/storage')
-rw-r--r-- | extensions/browser/api/storage/settings_storage_quota_enforcer.cc | 4 |
1 files changed, 3 insertions, 1 deletions
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; |