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

Unified Diff: components/data_reduction_proxy/core/browser/data_store_impl.cc

Issue 2810393002: Fix memory issues with the Data Reduction proxy LevelDB (Closed)
Patch Set: ryan comments 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
Index: components/data_reduction_proxy/core/browser/data_store_impl.cc
diff --git a/components/data_reduction_proxy/core/browser/data_store_impl.cc b/components/data_reduction_proxy/core/browser/data_store_impl.cc
index 76903bee1dfa8bb9b940173a9050e6c2f1064342..3c7c180fe9637de40870512c7d6720da7014f965 100644
--- a/components/data_reduction_proxy/core/browser/data_store_impl.cc
+++ b/components/data_reduction_proxy/core/browser/data_store_impl.cc
@@ -117,7 +117,9 @@ DataStore::Status DataStoreImpl::OpenDB() {
leveldb::Options options;
options.create_if_missing = true;
options.paranoid_checks = true;
- options.reuse_logs = leveldb_env::kDefaultLogReuseOptionValue;
+ // Deletes to buckets not found are stored in the log. Use a new log so that
+ // these log entries are deleted.
+ options.reuse_logs = false;
std::string db_name = profile_path_.Append(kDBName).AsUTF8Unsafe();
leveldb::DB* dbptr = nullptr;
Status status =
@@ -144,14 +146,13 @@ DataStore::Status DataStoreImpl::OpenDB() {
return status;
}
-void DataStoreImpl::RecreateDB() {
+DataStore::Status DataStoreImpl::RecreateDB() {
DCHECK(sequence_checker_.CalledOnValidSequence());
- LOG(WARNING) << "Deleting corrupt Data Reduction Proxy LevelDB";
db_.reset(nullptr);
base::DeleteFile(profile_path_.Append(kDBName), true);
- OpenDB();
+ return OpenDB();
}
} // namespace data_reduction_proxy

Powered by Google App Engine
This is Rietveld 408576698