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

Unified Diff: WebCore/platform/sql/SQLiteDatabase.h

Issue 596028: Make the DatabaseTracker thread-safe. (Closed) Base URL: http://svn.webkit.org/repository/webkit/trunk/
Patch Set: '' Created 10 years, 10 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 | « no previous file | WebCore/platform/sql/SQLiteDatabase.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: WebCore/platform/sql/SQLiteDatabase.h
===================================================================
--- WebCore/platform/sql/SQLiteDatabase.h (revision 55036)
+++ WebCore/platform/sql/SQLiteDatabase.h (working copy)
@@ -97,7 +97,7 @@
const char* lastErrorMsg();
sqlite3* sqlite3Handle() const {
- ASSERT(currentThread() == m_openingThread);
+ ASSERT(m_sharable || currentThread() == m_openingThread);
return m_db;
}
@@ -108,6 +108,12 @@
void unlock();
bool isAutoCommitOn() const;
+ // Set this flag to allow access from multiple threads. Not all multi-threaded accesses are safe!
+ // See http://www.sqlite.org/cvstrac/wiki?p=MultiThreading for more info, and you must be running with compile flags and SQLite version appropriate
+ // to your cross-thread uses.
+ bool sharable() { return m_sharable; }
+ void setSharable(bool sharable) { m_sharable = sharable; }
+
private:
static int authorizerFunction(void*, int, const char*, const char*, const char*, const char*);
@@ -120,6 +126,7 @@
int m_pageSize;
bool m_transactionInProgress;
+ bool m_sharable;
Mutex m_authorizerLock;
RefPtr<DatabaseAuthorizer> m_authorizer;
« no previous file with comments | « no previous file | WebCore/platform/sql/SQLiteDatabase.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698