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

Unified Diff: content/browser/indexed_db/leveldb/leveldb_database.cc

Issue 397323003: LevelDBDatabase::Compact compacts db (on disk) w/o requiring reopen. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Compacting after waiting for previous writes to finish. Created 6 years, 5 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 | « content/browser/indexed_db/indexed_db_browsertest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/indexed_db/leveldb/leveldb_database.cc
diff --git a/content/browser/indexed_db/leveldb/leveldb_database.cc b/content/browser/indexed_db/leveldb/leveldb_database.cc
index 8bcb517db41c1b2ba5b5a97fa89292b63a286e31..9e70f463856ad7e1c5ab5a0e2fb69e161853be60 100644
--- a/content/browser/indexed_db/leveldb/leveldb_database.cc
+++ b/content/browser/indexed_db/leveldb/leveldb_database.cc
@@ -395,6 +395,8 @@ void LevelDBDatabase::Compact(const base::StringPiece& start,
const base::StringPiece& stop) {
const leveldb::Slice start_slice = MakeSlice(start);
const leveldb::Slice stop_slice = MakeSlice(stop);
+ // NULL batch means just wait for earlier writes to be done
+ db_->Write(leveldb::WriteOptions(), NULL);
db_->CompactRange(&start_slice, &stop_slice);
}
« no previous file with comments | « content/browser/indexed_db/indexed_db_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698