summaryrefslogtreecommitdiffstats
path: root/WebCore/storage/AbstractDatabase.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/storage/AbstractDatabase.cpp')
-rw-r--r--WebCore/storage/AbstractDatabase.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/WebCore/storage/AbstractDatabase.cpp b/WebCore/storage/AbstractDatabase.cpp
index ca9a1b5..bcc5d06 100644
--- a/WebCore/storage/AbstractDatabase.cpp
+++ b/WebCore/storage/AbstractDatabase.cpp
@@ -32,7 +32,6 @@
#if ENABLE(DATABASE)
#include "DatabaseAuthorizer.h"
#include "DatabaseTracker.h"
-#include "ExceptionCode.h"
#include "Logging.h"
#include "SQLiteStatement.h"
#include "ScriptExecutionContext.h"
@@ -462,6 +461,19 @@ void AbstractDatabase::resetAuthorizer()
m_databaseAuthorizer->reset();
}
+unsigned long long AbstractDatabase::maximumSize() const
+{
+ return DatabaseTracker::tracker().getMaxSizeForDatabase(this);
+}
+
+void AbstractDatabase::incrementalVacuumIfNeeded()
+{
+ int64_t freeSpaceSize = m_sqliteDatabase.freeSpaceSize();
+ int64_t totalSize = m_sqliteDatabase.totalSize();
+ if (totalSize <= 10 * freeSpaceSize)
+ m_sqliteDatabase.runIncrementalVacuumCommand();
+}
+
} // namespace WebCore
#endif // ENABLE(DATABASE)