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

Unified Diff: third_party/leveldatabase/env_chromium.h

Issue 2243363002: IndexedDB: Limit the size of a leveldb write buffer to minimize disk space. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Eliminated overloaded WriteBufferSize. Created 4 years, 4 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/leveldb/leveldb_database.cc ('k') | third_party/leveldatabase/env_chromium.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/leveldatabase/env_chromium.h
diff --git a/third_party/leveldatabase/env_chromium.h b/third_party/leveldatabase/env_chromium.h
index 51f28666c34479125e9f150877a2dac6b23ed983..d2e5b83111c79974c2b93622dedf2ec8aaf0eb8c 100644
--- a/third_party/leveldatabase/env_chromium.h
+++ b/third_party/leveldatabase/env_chromium.h
@@ -97,6 +97,15 @@ int GetNumCorruptionCodes();
std::string GetCorruptionMessage(const leveldb::Status& status);
bool IndicatesDiskFull(const leveldb::Status& status);
+// Determine the appropriate leveldb write buffer size to use. The default size
+// (4MB) may result in a log file too large to be compacted given the available
+// storage space. This function will return smaller values for smaller disks,
+// and the default leveldb value for larger disks.
+//
+// |disk_space| is the logical partition size (in bytes), and *not* available
+// space. A value of -1 will return leveldb's default write buffer size.
+extern size_t WriteBufferSize(int64_t disk_space);
+
class UMALogger {
public:
virtual void RecordErrorAt(MethodID method) const = 0;
« no previous file with comments | « content/browser/indexed_db/leveldb/leveldb_database.cc ('k') | third_party/leveldatabase/env_chromium.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698