summaryrefslogtreecommitdiffstats
path: root/WebCore/platform/sql/SQLiteDatabase.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/platform/sql/SQLiteDatabase.cpp')
-rw-r--r--WebCore/platform/sql/SQLiteDatabase.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/WebCore/platform/sql/SQLiteDatabase.cpp b/WebCore/platform/sql/SQLiteDatabase.cpp
index 702cf02..e16b04e 100644
--- a/WebCore/platform/sql/SQLiteDatabase.cpp
+++ b/WebCore/platform/sql/SQLiteDatabase.cpp
@@ -151,6 +151,18 @@ int SQLiteDatabase::pageSize()
return m_pageSize;
}
+int64_t SQLiteDatabase::freeSpaceSize()
+{
+ MutexLocker locker(m_authorizerLock);
+ enableAuthorizer(false);
+ // Note: freelist_count was added in SQLite 3.4.1.
+ SQLiteStatement statement(*this, "PRAGMA freelist_count");
+ int64_t size = statement.getColumnInt64(0) * pageSize();
+
+ enableAuthorizer(true);
+ return size;
+}
+
void SQLiteDatabase::setSynchronous(SynchronousPragma sync)
{
executeCommand(String::format("PRAGMA synchronous = %i", sync));