summaryrefslogtreecommitdiffstats
path: root/WebCore/platform/sql/SQLiteDatabase.cpp
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2010-04-27 16:31:00 +0100
committerSteve Block <steveblock@google.com>2010-05-11 14:42:12 +0100
commitdcc8cf2e65d1aa555cce12431a16547e66b469ee (patch)
tree92a8d65cd5383bca9749f5327fb5e440563926e6 /WebCore/platform/sql/SQLiteDatabase.cpp
parentccac38a6b48843126402088a309597e682f40fe6 (diff)
downloadexternal_webkit-dcc8cf2e65d1aa555cce12431a16547e66b469ee.zip
external_webkit-dcc8cf2e65d1aa555cce12431a16547e66b469ee.tar.gz
external_webkit-dcc8cf2e65d1aa555cce12431a16547e66b469ee.tar.bz2
Merge webkit.org at r58033 : Initial merge by git
Change-Id: If006c38561af287c50cd578d251629b51e4d8cd1
Diffstat (limited to 'WebCore/platform/sql/SQLiteDatabase.cpp')
-rw-r--r--WebCore/platform/sql/SQLiteDatabase.cpp21
1 files changed, 17 insertions, 4 deletions
diff --git a/WebCore/platform/sql/SQLiteDatabase.cpp b/WebCore/platform/sql/SQLiteDatabase.cpp
index faaf5de..58fdc7c 100644
--- a/WebCore/platform/sql/SQLiteDatabase.cpp
+++ b/WebCore/platform/sql/SQLiteDatabase.cpp
@@ -48,6 +48,7 @@ SQLiteDatabase::SQLiteDatabase()
: m_db(0)
, m_pageSize(-1)
, m_transactionInProgress(false)
+ , m_sharable(false)
, m_openingThread(0)
{
}
@@ -57,11 +58,11 @@ SQLiteDatabase::~SQLiteDatabase()
close();
}
-bool SQLiteDatabase::open(const String& filename)
+bool SQLiteDatabase::open(const String& filename, bool forWebSQLDatabase)
{
close();
-
- m_lastError = SQLiteFileSystem::openDatabase(filename, &m_db);
+
+ m_lastError = SQLiteFileSystem::openDatabase(filename, &m_db, forWebSQLDatabase);
if (m_lastError != SQLITE_OK) {
LOG_ERROR("SQLite database failed to load from %s\nCause - %s", filename.ascii().data(),
sqlite3_errmsg(m_db));
@@ -72,7 +73,7 @@ bool SQLiteDatabase::open(const String& filename)
if (isOpen())
m_openingThread = currentThread();
-
+
if (!SQLiteStatement(*this, "PRAGMA temp_store = MEMORY;").executeCommand())
LOG_ERROR("SQLite database could not set temp_store to memory");
@@ -252,6 +253,18 @@ const char* SQLiteDatabase::lastErrorMsg()
return sqlite3_errmsg(m_db);
}
+#ifndef NDEBUG
+void SQLiteDatabase::disableThreadingChecks()
+{
+ // This doesn't guarantee that SQList was compiled with -DTHREADSAFE, or that you haven't turned off the mutexes.
+#if SQLITE_VERSION_NUMBER >= 3003001
+ m_sharable = true;
+#else
+ ASSERT(0); // Your SQLite doesn't support sharing handles across threads.
+#endif
+}
+#endif
+
int SQLiteDatabase::authorizerFunction(void* userData, int actionCode, const char* parameter1, const char* parameter2, const char* /*databaseName*/, const char* /*trigger_or_view*/)
{
DatabaseAuthorizer* auth = static_cast<DatabaseAuthorizer*>(userData);