[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
commit-queue at webkit.org
commit-queue at webkit.org
Wed Dec 22 11:35:39 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 89bbc2478ba4331eed0bd65d0fb0a23a2b65fbda
Author: commit-queue at webkit.org <commit-queue at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Jul 30 05:09:47 2010 +0000
2010-07-29 Sheriff Bot <webkit.review.bot at gmail.com>
Unreviewed, rolling out r64313.
http://trac.webkit.org/changeset/64313
https://bugs.webkit.org/show_bug.cgi?id=43233
Some Chromium bots are not happy with it for some unknown
reason. (Requested by dumi on #webkit).
* JavaScriptCore.exp:
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
* wtf/Threading.h:
* wtf/ThreadingPthreads.cpp:
* wtf/ThreadingWin.cpp:
* wtf/gtk/ThreadingGtk.cpp:
* wtf/qt/ThreadingQt.cpp:
2010-07-29 Sheriff Bot <webkit.review.bot at gmail.com>
Unreviewed, rolling out r64313.
http://trac.webkit.org/changeset/64313
https://bugs.webkit.org/show_bug.cgi?id=43233
Some Chromium bots are not happy with it for some unknown
reason. (Requested by dumi on #webkit).
* fast/workers/storage/interrupt-database-expected.txt: Removed.
* fast/workers/storage/interrupt-database-sync-expected.txt: Removed.
* fast/workers/storage/interrupt-database-sync.html: Removed.
* fast/workers/storage/interrupt-database.html: Removed.
* fast/workers/storage/resources/interrupt-database-sync.js: Removed.
* fast/workers/storage/resources/interrupt-database.js: Removed.
2010-07-29 Sheriff Bot <webkit.review.bot at gmail.com>
Unreviewed, rolling out r64313.
http://trac.webkit.org/changeset/64313
https://bugs.webkit.org/show_bug.cgi?id=43233
Some Chromium bots are not happy with it for some unknown
reason. (Requested by dumi on #webkit).
* bindings/js/JSCustomVoidCallback.cpp:
(WebCore::JSCustomVoidCallback::~JSCustomVoidCallback):
* bindings/scripts/CodeGeneratorJS.pm:
* bindings/scripts/test/JS/JSTestCallback.cpp:
(WebCore::JSTestCallback::~JSTestCallback):
* platform/sql/SQLiteDatabase.cpp:
(WebCore::SQLiteDatabase::SQLiteDatabase):
(WebCore::SQLiteDatabase::close):
(WebCore::SQLiteDatabase::lock):
(WebCore::SQLiteDatabase::unlock):
* platform/sql/SQLiteDatabase.h:
* platform/sql/SQLiteStatement.cpp:
(WebCore::SQLiteStatement::prepare):
(WebCore::SQLiteStatement::step):
* storage/AbstractDatabase.cpp:
* storage/AbstractDatabase.h:
* storage/DatabaseTracker.cpp:
* storage/DatabaseTracker.h:
* storage/SQLStatement.cpp:
(WebCore::SQLStatement::execute):
* storage/SQLStatementSync.cpp:
(WebCore::SQLStatementSync::execute):
* storage/SQLTransaction.cpp:
(WebCore::SQLTransaction::checkAndHandleClosedDatabase):
(WebCore::SQLTransaction::performNextStep):
(WebCore::SQLTransaction::performPendingCallback):
(WebCore::SQLTransaction::deliverTransactionCallback):
(WebCore::SQLTransaction::postflightAndCommit):
(WebCore::SQLTransaction::deliverTransactionErrorCallback):
(WebCore::SQLTransaction::cleanupAfterTransactionErrorCallback):
* storage/SQLTransaction.h:
* storage/chromium/DatabaseTrackerChromium.cpp:
* workers/WorkerThread.cpp:
(WebCore::WorkerThread::stop):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@64334 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/JavaScriptCore/ChangeLog b/JavaScriptCore/ChangeLog
index d5bb80d..684d1b4 100644
--- a/JavaScriptCore/ChangeLog
+++ b/JavaScriptCore/ChangeLog
@@ -1,5 +1,22 @@
2010-07-29 Sheriff Bot <webkit.review.bot at gmail.com>
+ Unreviewed, rolling out r64313.
+ http://trac.webkit.org/changeset/64313
+ https://bugs.webkit.org/show_bug.cgi?id=43233
+
+ Some Chromium bots are not happy with it for some unknown
+ reason. (Requested by dumi on #webkit).
+
+ * JavaScriptCore.exp:
+ * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
+ * wtf/Threading.h:
+ * wtf/ThreadingPthreads.cpp:
+ * wtf/ThreadingWin.cpp:
+ * wtf/gtk/ThreadingGtk.cpp:
+ * wtf/qt/ThreadingQt.cpp:
+
+2010-07-29 Sheriff Bot <webkit.review.bot at gmail.com>
+
Unreviewed, rolling out r64302.
http://trac.webkit.org/changeset/64302
https://bugs.webkit.org/show_bug.cgi?id=43223
diff --git a/JavaScriptCore/JavaScriptCore.exp b/JavaScriptCore/JavaScriptCore.exp
index b66d8df..93e01e2 100644
--- a/JavaScriptCore/JavaScriptCore.exp
+++ b/JavaScriptCore/JavaScriptCore.exp
@@ -367,7 +367,6 @@ __ZN3WTF5Mutex6unlockEv
__ZN3WTF5Mutex7tryLockEv
__ZN3WTF5MutexC1Ev
__ZN3WTF5MutexD1Ev
-__ZN3WTF5yieldEv
__ZN3WTF6strtodEPKcPPc
__ZN3WTF7CString11mutableDataEv
__ZN3WTF7CString16newUninitializedEmRPc
diff --git a/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def b/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def
index a478725..a6ff1c2 100644
--- a/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def
+++ b/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def
@@ -330,7 +330,6 @@ EXPORTS
?wait at ThreadCondition@WTF@@QAEXAAVMutex at 2@@Z
?waitForThreadCompletion at WTF@@YAHIPAPAX at Z
?writable at PropertyDescriptor@JSC@@QBE_NXZ
- ?yield at WTF@@YAXXZ
WTFLog
WTFLogVerbose
WTFReportArgumentAssertionFailure
diff --git a/JavaScriptCore/wtf/Threading.h b/JavaScriptCore/wtf/Threading.h
index 044365f..415a8fc 100644
--- a/JavaScriptCore/wtf/Threading.h
+++ b/JavaScriptCore/wtf/Threading.h
@@ -101,7 +101,6 @@ ThreadIdentifier currentThread();
int waitForThreadCompletion(ThreadIdentifier, void**);
void detachThread(ThreadIdentifier);
-void yield();
void lockAtomicallyInitializedStaticMutex();
void unlockAtomicallyInitializedStaticMutex();
@@ -113,6 +112,5 @@ using WTF::createThread;
using WTF::currentThread;
using WTF::detachThread;
using WTF::waitForThreadCompletion;
-using WTF::yield;
#endif // Threading_h
diff --git a/JavaScriptCore/wtf/ThreadingPthreads.cpp b/JavaScriptCore/wtf/ThreadingPthreads.cpp
index 98286d3..d01cc4a 100644
--- a/JavaScriptCore/wtf/ThreadingPthreads.cpp
+++ b/JavaScriptCore/wtf/ThreadingPthreads.cpp
@@ -44,7 +44,6 @@
#if !COMPILER(MSVC)
#include <limits.h>
-#include <sched.h>
#include <sys/time.h>
#endif
@@ -222,11 +221,6 @@ void detachThread(ThreadIdentifier threadID)
pthread_detach(pthreadHandle);
}
-void yield()
-{
- sched_yield();
-}
-
ThreadIdentifier currentThread()
{
ThreadIdentifier id = ThreadIdentifierData::identifier();
diff --git a/JavaScriptCore/wtf/ThreadingWin.cpp b/JavaScriptCore/wtf/ThreadingWin.cpp
index a29fbbb..c16be5a 100644
--- a/JavaScriptCore/wtf/ThreadingWin.cpp
+++ b/JavaScriptCore/wtf/ThreadingWin.cpp
@@ -266,11 +266,6 @@ void detachThread(ThreadIdentifier threadID)
clearThreadHandleForIdentifier(threadID);
}
-void yield()
-{
- ::Sleep(1);
-}
-
ThreadIdentifier currentThread()
{
return static_cast<ThreadIdentifier>(GetCurrentThreadId());
diff --git a/JavaScriptCore/wtf/gtk/ThreadingGtk.cpp b/JavaScriptCore/wtf/gtk/ThreadingGtk.cpp
index 863ee81..981eacb 100644
--- a/JavaScriptCore/wtf/gtk/ThreadingGtk.cpp
+++ b/JavaScriptCore/wtf/gtk/ThreadingGtk.cpp
@@ -167,11 +167,6 @@ ThreadIdentifier currentThread()
return establishIdentifierForThread(currentThread);
}
-void yield()
-{
- g_thread_yield();
-}
-
Mutex::Mutex()
: m_mutex(g_mutex_new())
{
diff --git a/JavaScriptCore/wtf/qt/ThreadingQt.cpp b/JavaScriptCore/wtf/qt/ThreadingQt.cpp
index 8041dea..7f81646 100644
--- a/JavaScriptCore/wtf/qt/ThreadingQt.cpp
+++ b/JavaScriptCore/wtf/qt/ThreadingQt.cpp
@@ -208,11 +208,6 @@ ThreadIdentifier currentThread()
return establishIdentifierForThread(currentThread);
}
-void yield()
-{
- QThread::yieldCurrentThread();
-}
-
Mutex::Mutex()
: m_mutex(new QMutex())
{
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 33e987c..fd85902 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,19 @@
+2010-07-29 Sheriff Bot <webkit.review.bot at gmail.com>
+
+ Unreviewed, rolling out r64313.
+ http://trac.webkit.org/changeset/64313
+ https://bugs.webkit.org/show_bug.cgi?id=43233
+
+ Some Chromium bots are not happy with it for some unknown
+ reason. (Requested by dumi on #webkit).
+
+ * fast/workers/storage/interrupt-database-expected.txt: Removed.
+ * fast/workers/storage/interrupt-database-sync-expected.txt: Removed.
+ * fast/workers/storage/interrupt-database-sync.html: Removed.
+ * fast/workers/storage/interrupt-database.html: Removed.
+ * fast/workers/storage/resources/interrupt-database-sync.js: Removed.
+ * fast/workers/storage/resources/interrupt-database.js: Removed.
+
2010-07-29 Victor Wang <victorw at chromium.org>
Unreviewed. Update chromium test expectations for test:
diff --git a/LayoutTests/fast/workers/storage/interrupt-database-expected.txt b/LayoutTests/fast/workers/storage/interrupt-database-expected.txt
deleted file mode 100644
index 460a756..0000000
--- a/LayoutTests/fast/workers/storage/interrupt-database-expected.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-This test makes sure that all async database operations are immediately interrupted when the worker needs to terminate.
-PASS: database operations interrupted.
-
diff --git a/LayoutTests/fast/workers/storage/interrupt-database-sync-expected.txt b/LayoutTests/fast/workers/storage/interrupt-database-sync-expected.txt
deleted file mode 100644
index 3139ddc..0000000
--- a/LayoutTests/fast/workers/storage/interrupt-database-sync-expected.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-CONSOLE MESSAGE: line 7: DATABASE_ERR: DOM SQL Exception 1: The operation failed for some reason related to the database.
-CONSOLE MESSAGE: line 11: UNKNOWN_ERR: DOM SQL Exception 0: The operation failed for reasons unrelated to the database.
-This test makes sure that all sync database operations are immediately interrupted when the worker needs to terminate.
-PASS: database operations interrupted.
-
diff --git a/LayoutTests/fast/workers/storage/interrupt-database-sync.html b/LayoutTests/fast/workers/storage/interrupt-database-sync.html
deleted file mode 100644
index deabee0..0000000
--- a/LayoutTests/fast/workers/storage/interrupt-database-sync.html
+++ /dev/null
@@ -1,48 +0,0 @@
-<html>
-<head>
-<script src="../resources/worker-util.js"></script>
-<script>
-var worker;
-
-function log(message)
-{
- document.getElementById("console").innerHTML += message + "<br>";
-}
-
-function finishTest()
-{
- log("PASS: database operations interrupted.");
- if (window.layoutTestController)
- layoutTestController.notifyDone();
-}
-
-function terminateWorker()
-{
- worker.terminate();
- waitUntilWorkerThreadsExit(finishTest)
-}
-
-function runTest()
-{
- if (window.layoutTestController) {
- layoutTestController.dumpAsText();
- layoutTestController.waitUntilDone();
- }
-
- worker = new Worker('resources/interrupt-database-sync.js');
- worker.onmessage = function(event) {
- if (event.data == "terminate")
- terminateWorker();
- else
- log(event.data);
- };
-}
-</script>
-</head>
-
-<body onload="runTest()">
-This test makes sure that all sync database operations are immediately interrupted when the worker needs to terminate.
-<pre id="console">
-</pre>
-</body>
-</html>
diff --git a/LayoutTests/fast/workers/storage/interrupt-database.html b/LayoutTests/fast/workers/storage/interrupt-database.html
deleted file mode 100644
index 2ff4d45..0000000
--- a/LayoutTests/fast/workers/storage/interrupt-database.html
+++ /dev/null
@@ -1,48 +0,0 @@
-<html>
-<head>
-<script src="../resources/worker-util.js"></script>
-<script>
-var worker;
-
-function log(message)
-{
- document.getElementById("console").innerHTML += message + "<br>";
-}
-
-function finishTest()
-{
- log("PASS: database operations interrupted.");
- if (window.layoutTestController)
- layoutTestController.notifyDone();
-}
-
-function terminateWorker()
-{
- worker.terminate();
- waitUntilWorkerThreadsExit(finishTest)
-}
-
-function runTest()
-{
- if (window.layoutTestController) {
- layoutTestController.dumpAsText();
- layoutTestController.waitUntilDone();
- }
-
- worker = new Worker('resources/interrupt-database.js');
- worker.onmessage = function(event) {
- if (event.data == "terminate")
- terminateWorker();
- else
- log(event.data);
- };
-}
-</script>
-</head>
-
-<body onload="runTest()">
-This test makes sure that all async database operations are immediately interrupted when the worker needs to terminate.
-<pre id="console">
-</pre>
-</body>
-</html>
diff --git a/LayoutTests/fast/workers/storage/resources/interrupt-database-sync.js b/LayoutTests/fast/workers/storage/resources/interrupt-database-sync.js
deleted file mode 100644
index e533f08..0000000
--- a/LayoutTests/fast/workers/storage/resources/interrupt-database-sync.js
+++ /dev/null
@@ -1,11 +0,0 @@
-var db = openDatabaseSync("InterruptDatabaseSyncTest", "1", "", 1);
-db.transaction(function(tx) {
- tx.executeSql("CREATE TABLE IF NOT EXISTS Test (Foo INT)");
- var counter = 0;
- while (true) {
- // Put both statements on the same line, to make sure the exception is always reported on the same line.
- tx.executeSql("INSERT INTO Test VALUES (1)"); tx.executeSql("DELETE FROM Test WHERE Foo = 1");
- if (++counter == 100)
- postMessage("terminate");
- }
-});
diff --git a/LayoutTests/fast/workers/storage/resources/interrupt-database.js b/LayoutTests/fast/workers/storage/resources/interrupt-database.js
deleted file mode 100644
index 3f71a45..0000000
--- a/LayoutTests/fast/workers/storage/resources/interrupt-database.js
+++ /dev/null
@@ -1,19 +0,0 @@
-var counter = 0;
-function runTransaction()
-{
- db.transaction(function(tx) {
- tx.executeSql("INSERT INTO Test VALUES (1)");
- tx.executeSql("DELETE FROM Test WHERE Foo = 1");
- if (++counter == 100)
- postMessage("terminate");
- }, null, runTransaction);
-}
-
-var db = openDatabase("InterruptDatabaseTest", "1", "", 1);
-db.transaction(function(tx) {
- tx.executeSql("CREATE TABLE IF NOT EXISTS Test (Foo INT)");
-}, function(error) {
- postMessage("Error: " + error.message);
-}, function() {
- runTransaction();
-});
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index a94e091..2491cda 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,47 @@
+2010-07-29 Sheriff Bot <webkit.review.bot at gmail.com>
+
+ Unreviewed, rolling out r64313.
+ http://trac.webkit.org/changeset/64313
+ https://bugs.webkit.org/show_bug.cgi?id=43233
+
+ Some Chromium bots are not happy with it for some unknown
+ reason. (Requested by dumi on #webkit).
+
+ * bindings/js/JSCustomVoidCallback.cpp:
+ (WebCore::JSCustomVoidCallback::~JSCustomVoidCallback):
+ * bindings/scripts/CodeGeneratorJS.pm:
+ * bindings/scripts/test/JS/JSTestCallback.cpp:
+ (WebCore::JSTestCallback::~JSTestCallback):
+ * platform/sql/SQLiteDatabase.cpp:
+ (WebCore::SQLiteDatabase::SQLiteDatabase):
+ (WebCore::SQLiteDatabase::close):
+ (WebCore::SQLiteDatabase::lock):
+ (WebCore::SQLiteDatabase::unlock):
+ * platform/sql/SQLiteDatabase.h:
+ * platform/sql/SQLiteStatement.cpp:
+ (WebCore::SQLiteStatement::prepare):
+ (WebCore::SQLiteStatement::step):
+ * storage/AbstractDatabase.cpp:
+ * storage/AbstractDatabase.h:
+ * storage/DatabaseTracker.cpp:
+ * storage/DatabaseTracker.h:
+ * storage/SQLStatement.cpp:
+ (WebCore::SQLStatement::execute):
+ * storage/SQLStatementSync.cpp:
+ (WebCore::SQLStatementSync::execute):
+ * storage/SQLTransaction.cpp:
+ (WebCore::SQLTransaction::checkAndHandleClosedDatabase):
+ (WebCore::SQLTransaction::performNextStep):
+ (WebCore::SQLTransaction::performPendingCallback):
+ (WebCore::SQLTransaction::deliverTransactionCallback):
+ (WebCore::SQLTransaction::postflightAndCommit):
+ (WebCore::SQLTransaction::deliverTransactionErrorCallback):
+ (WebCore::SQLTransaction::cleanupAfterTransactionErrorCallback):
+ * storage/SQLTransaction.h:
+ * storage/chromium/DatabaseTrackerChromium.cpp:
+ * workers/WorkerThread.cpp:
+ (WebCore::WorkerThread::stop):
+
2010-07-29 Martin Robinson <mrobinson at igalia.com>
Unreviewed, rolling out r64318.
diff --git a/WebCore/bindings/js/JSCustomVoidCallback.cpp b/WebCore/bindings/js/JSCustomVoidCallback.cpp
index 96b5412..d5c4ac3 100644
--- a/WebCore/bindings/js/JSCustomVoidCallback.cpp
+++ b/WebCore/bindings/js/JSCustomVoidCallback.cpp
@@ -48,10 +48,7 @@ JSCustomVoidCallback::JSCustomVoidCallback(JSObject* callback, JSDOMGlobalObject
JSCustomVoidCallback::~JSCustomVoidCallback()
{
- if (m_scriptExecutionContext->isContextThread())
- delete m_data;
- else
- m_scriptExecutionContext->postTask(DeleteCallbackDataTask::create(m_data));
+ m_scriptExecutionContext->postTask(DeleteCallbackDataTask::create(m_data));
#ifndef NDEBUG
m_data = 0;
#endif
diff --git a/WebCore/bindings/scripts/CodeGeneratorJS.pm b/WebCore/bindings/scripts/CodeGeneratorJS.pm
index dd8c87c..05f532c 100644
--- a/WebCore/bindings/scripts/CodeGeneratorJS.pm
+++ b/WebCore/bindings/scripts/CodeGeneratorJS.pm
@@ -2151,10 +2151,7 @@ sub GenerateCallbackImplementation
# Destructor
push(@implContent, "${className}::~${className}()\n");
push(@implContent, "{\n");
- push(@implContent, " if (m_scriptExecutionContext->isContextThread())\n");
- push(@implContent, " delete m_data;\n");
- push(@implContent, " else\n");
- push(@implContent, " m_scriptExecutionContext->postTask(DeleteCallbackDataTask::create(m_data));\n");
+ push(@implContent, " m_scriptExecutionContext->postTask(DeleteCallbackDataTask::create(m_data));\n");
push(@implContent, "#ifndef NDEBUG\n");
push(@implContent, " m_data = 0;\n");
push(@implContent, "#endif\n");
diff --git a/WebCore/bindings/scripts/test/JS/JSTestCallback.cpp b/WebCore/bindings/scripts/test/JS/JSTestCallback.cpp
index 6f6b568..043a6ed 100644
--- a/WebCore/bindings/scripts/test/JS/JSTestCallback.cpp
+++ b/WebCore/bindings/scripts/test/JS/JSTestCallback.cpp
@@ -43,10 +43,7 @@ JSTestCallback::JSTestCallback(JSObject* callback, JSDOMGlobalObject* globalObje
JSTestCallback::~JSTestCallback()
{
- if (m_scriptExecutionContext->isContextThread())
- delete m_data;
- else
- m_scriptExecutionContext->postTask(DeleteCallbackDataTask::create(m_data));
+ m_scriptExecutionContext->postTask(DeleteCallbackDataTask::create(m_data));
#ifndef NDEBUG
m_data = 0;
#endif
diff --git a/WebCore/platform/sql/SQLiteDatabase.cpp b/WebCore/platform/sql/SQLiteDatabase.cpp
index 2ca5ba4..75fc032 100644
--- a/WebCore/platform/sql/SQLiteDatabase.cpp
+++ b/WebCore/platform/sql/SQLiteDatabase.cpp
@@ -31,8 +31,8 @@
#include "Logging.h"
#include "SQLiteFileSystem.h"
#include "SQLiteStatement.h"
+
#include <sqlite3.h>
-#include <wtf/Threading.h>
namespace WebCore {
@@ -42,7 +42,7 @@ const int SQLResultOk = SQLITE_OK;
const int SQLResultRow = SQLITE_ROW;
const int SQLResultSchema = SQLITE_SCHEMA;
const int SQLResultFull = SQLITE_FULL;
-const int SQLResultInterrupt = SQLITE_INTERRUPT;
+
SQLiteDatabase::SQLiteDatabase()
: m_db(0)
@@ -50,7 +50,6 @@ SQLiteDatabase::SQLiteDatabase()
, m_transactionInProgress(false)
, m_sharable(false)
, m_openingThread(0)
- , m_interrupted(false)
{
}
@@ -84,38 +83,15 @@ bool SQLiteDatabase::open(const String& filename, bool forWebSQLDatabase)
void SQLiteDatabase::close()
{
if (m_db) {
- ASSERT(currentThread() == m_openingThread);
- sqlite3* db = m_db;
- {
- MutexLocker locker(m_databaseClosingMutex);
- m_db = 0;
- }
- sqlite3_close(db);
+ // FIXME: This is being called on themain thread during JS GC. <rdar://problem/5739818>
+ // ASSERT(currentThread() == m_openingThread);
+ sqlite3_close(m_db);
+ m_db = 0;
}
m_openingThread = 0;
}
-void SQLiteDatabase::interrupt()
-{
- m_interrupted = true;
- while (!m_lockingMutex.tryLock()) {
- MutexLocker locker(m_databaseClosingMutex);
- if (!m_db)
- return;
- sqlite3_interrupt(m_db);
- yield();
- }
-
- m_lockingMutex.unlock();
-}
-
-bool SQLiteDatabase::isInterrupted()
-{
- ASSERT(!m_lockingMutex.tryLock());
- return m_interrupted;
-}
-
void SQLiteDatabase::setFullsync(bool fsync)
{
if (fsync)
@@ -421,6 +397,16 @@ void SQLiteDatabase::enableAuthorizer(bool enable)
sqlite3_set_authorizer(m_db, NULL, 0);
}
+void SQLiteDatabase::lock()
+{
+ m_lockingMutex.lock();
+}
+
+void SQLiteDatabase::unlock()
+{
+ m_lockingMutex.unlock();
+}
+
bool SQLiteDatabase::isAutoCommitOn() const
{
return sqlite3_get_autocommit(m_db);
diff --git a/WebCore/platform/sql/SQLiteDatabase.h b/WebCore/platform/sql/SQLiteDatabase.h
index 8151380..c5924c0 100644
--- a/WebCore/platform/sql/SQLiteDatabase.h
+++ b/WebCore/platform/sql/SQLiteDatabase.h
@@ -48,7 +48,6 @@ extern const int SQLResultOk;
extern const int SQLResultRow;
extern const int SQLResultSchema;
extern const int SQLResultFull;
-extern const int SQLResultInterrupt;
class SQLiteDatabase : public Noncopyable {
friend class SQLiteTransaction;
@@ -59,8 +58,6 @@ public:
bool open(const String& filename, bool forWebSQLDatabase = false);
bool isOpen() const { return m_db; }
void close();
- void interrupt();
- bool isInterrupted();
bool executeCommand(const String&);
bool returnsAtLeastOneResult(const String&);
@@ -108,7 +105,9 @@ public:
void setAuthorizer(PassRefPtr<DatabaseAuthorizer>);
- Mutex& databaseMutex() { return m_lockingMutex; }
+ // (un)locks the database like a mutex
+ void lock();
+ void unlock();
bool isAutoCommitOn() const;
// The SQLite AUTO_VACUUM pragma can be either NONE, FULL, or INCREMENTAL.
@@ -150,9 +149,7 @@ private:
Mutex m_lockingMutex;
ThreadIdentifier m_openingThread;
-
- Mutex m_databaseClosingMutex;
- bool m_interrupted;
+
}; // class SQLiteDatabase
} // namespace WebCore
diff --git a/WebCore/platform/sql/SQLiteStatement.cpp b/WebCore/platform/sql/SQLiteStatement.cpp
index ac467a6..78bbfeb 100644
--- a/WebCore/platform/sql/SQLiteStatement.cpp
+++ b/WebCore/platform/sql/SQLiteStatement.cpp
@@ -61,11 +61,6 @@ SQLiteStatement::~SQLiteStatement()
int SQLiteStatement::prepare()
{
ASSERT(!m_isPrepared);
-
- MutexLocker databaseLock(m_database.databaseMutex());
- if (m_database.isInterrupted())
- return SQLITE_INTERRUPT;
-
const void* tail = 0;
LOG(SQLDatabase, "SQL - prepare - %s", m_query.ascii().data());
String strippedQuery = m_query.stripWhiteSpace();
@@ -93,11 +88,6 @@ int SQLiteStatement::prepare()
int SQLiteStatement::step()
{
ASSERT(m_isPrepared);
-
- MutexLocker databaseLock(m_database.databaseMutex());
- if (m_database.isInterrupted())
- return SQLITE_INTERRUPT;
-
if (!m_statement)
return SQLITE_OK;
LOG(SQLDatabase, "SQL - step - %s", m_query.ascii().data());
diff --git a/WebCore/storage/AbstractDatabase.cpp b/WebCore/storage/AbstractDatabase.cpp
index 7827ec8..bcc5d06 100644
--- a/WebCore/storage/AbstractDatabase.cpp
+++ b/WebCore/storage/AbstractDatabase.cpp
@@ -474,17 +474,6 @@ void AbstractDatabase::incrementalVacuumIfNeeded()
m_sqliteDatabase.runIncrementalVacuumCommand();
}
-void AbstractDatabase::interrupt()
-{
- m_sqliteDatabase.interrupt();
-}
-
-bool AbstractDatabase::isInterrupted()
-{
- MutexLocker locker(m_sqliteDatabase.databaseMutex());
- return m_sqliteDatabase.isInterrupted();
-}
-
} // namespace WebCore
#endif // ENABLE(DATABASE)
diff --git a/WebCore/storage/AbstractDatabase.h b/WebCore/storage/AbstractDatabase.h
index 3d8d363..e302909 100644
--- a/WebCore/storage/AbstractDatabase.h
+++ b/WebCore/storage/AbstractDatabase.h
@@ -68,8 +68,6 @@ public:
unsigned long long maximumSize() const;
void incrementalVacuumIfNeeded();
- void interrupt();
- bool isInterrupted();
// FIXME: move all version-related methods to a DatabaseVersionTracker class
bool versionMatchesExpected() const;
diff --git a/WebCore/storage/DatabaseTracker.cpp b/WebCore/storage/DatabaseTracker.cpp
index 0764db0..de38ec3 100644
--- a/WebCore/storage/DatabaseTracker.cpp
+++ b/WebCore/storage/DatabaseTracker.cpp
@@ -235,35 +235,6 @@ void DatabaseTracker::databaseChanged(AbstractDatabase* database)
originQuotaManager().markDatabase(database);
}
-void DatabaseTracker::interruptAllDatabasesForContext(const ScriptExecutionContext* context)
-{
- Vector<RefPtr<AbstractDatabase> > openDatabases;
- {
- MutexLocker openDatabaseMapLock(m_openDatabaseMapGuard);
-
- if (!m_openDatabaseMap)
- return;
-
- DatabaseNameMap* nameMap = m_openDatabaseMap->get(context->securityOrigin());
- if (!nameMap)
- return;
-
- DatabaseNameMap::const_iterator dbNameMapEndIt = nameMap->end();
- for (DatabaseNameMap::const_iterator dbNameMapIt = nameMap->begin(); dbNameMapIt != dbNameMapEndIt; ++dbNameMapIt) {
- DatabaseSet* databaseSet = dbNameMapIt->second;
- DatabaseSet::const_iterator dbSetEndIt = databaseSet->end();
- for (DatabaseSet::const_iterator dbSetIt = databaseSet->begin(); dbSetIt != dbSetEndIt; ++dbSetIt) {
- if ((*dbSetIt)->scriptExecutionContext() == context)
- openDatabases.append(*dbSetIt);
- }
- }
- }
-
- Vector<RefPtr<AbstractDatabase> >::const_iterator openDatabasesEndIt = openDatabases.end();
- for (Vector<RefPtr<AbstractDatabase> >::const_iterator openDatabasesIt = openDatabases.begin(); openDatabasesIt != openDatabasesEndIt; ++openDatabasesIt)
- (*openDatabasesIt)->interrupt();
-}
-
String DatabaseTracker::originPath(SecurityOrigin* origin) const
{
return SQLiteFileSystem::appendDatabaseFileNameToPath(m_databaseDirectoryPath.threadsafeCopy(), origin->databaseIdentifier());
diff --git a/WebCore/storage/DatabaseTracker.h b/WebCore/storage/DatabaseTracker.h
index 1557f0a..094ee66 100644
--- a/WebCore/storage/DatabaseTracker.h
+++ b/WebCore/storage/DatabaseTracker.h
@@ -78,8 +78,6 @@ public:
unsigned long long getMaxSizeForDatabase(const AbstractDatabase*);
void databaseChanged(AbstractDatabase*);
- void interruptAllDatabasesForContext(const ScriptExecutionContext*);
-
private:
DatabaseTracker(const String& databasePath);
diff --git a/WebCore/storage/SQLStatement.cpp b/WebCore/storage/SQLStatement.cpp
index 9dd249a..2d7d78e 100644
--- a/WebCore/storage/SQLStatement.cpp
+++ b/WebCore/storage/SQLStatement.cpp
@@ -78,7 +78,7 @@ bool SQLStatement::execute(Database* db)
if (result != SQLResultOk) {
LOG(StorageAPI, "Unable to verify correctness of statement %s - error %i (%s)", m_statement.ascii().data(), result, database->lastErrorMsg());
- m_error = SQLError::create(result == SQLResultInterrupt ? SQLError::DATABASE_ERR : SQLError::SYNTAX_ERR, database->lastErrorMsg());
+ m_error = SQLError::create(SQLError::SYNTAX_ERR, database->lastErrorMsg());
return false;
}
@@ -86,7 +86,7 @@ bool SQLStatement::execute(Database* db)
// If this is the case, they might be trying to do something fishy or malicious
if (statement.bindParameterCount() != m_arguments.size()) {
LOG(StorageAPI, "Bind parameter count doesn't match number of question marks");
- m_error = SQLError::create(db->isInterrupted() ? SQLError::DATABASE_ERR : SQLError::SYNTAX_ERR, "number of '?'s in statement string does not match argument count");
+ m_error = SQLError::create(SQLError::SYNTAX_ERR, "number of '?'s in statement string does not match argument count");
return false;
}
diff --git a/WebCore/storage/SQLStatementSync.cpp b/WebCore/storage/SQLStatementSync.cpp
index e47919f..7be3f50 100644
--- a/WebCore/storage/SQLStatementSync.cpp
+++ b/WebCore/storage/SQLStatementSync.cpp
@@ -61,12 +61,12 @@ PassRefPtr<SQLResultSet> SQLStatementSync::execute(DatabaseSync* db, ExceptionCo
SQLiteStatement statement(*database, m_statement);
int result = statement.prepare();
if (result != SQLResultOk) {
- ec = (result == SQLResultInterrupt ? SQLException::DATABASE_ERR : SQLException::SYNTAX_ERR);
+ ec = SQLException::SYNTAX_ERR;
return 0;
}
if (statement.bindParameterCount() != m_arguments.size()) {
- ec = (db->isInterrupted()? SQLException::DATABASE_ERR : SQLException::SYNTAX_ERR);
+ ec = SQLException::SYNTAX_ERR;
return 0;
}
diff --git a/WebCore/storage/SQLTransaction.cpp b/WebCore/storage/SQLTransaction.cpp
index 454ea63..e43d844 100644
--- a/WebCore/storage/SQLTransaction.cpp
+++ b/WebCore/storage/SQLTransaction.cpp
@@ -146,22 +146,17 @@ const char* SQLTransaction::debugStepName(SQLTransaction::TransactionStepMethod
}
#endif
-void SQLTransaction::checkAndHandleClosedOrInterruptedDatabase()
+void SQLTransaction::checkAndHandleClosedDatabase()
{
- if (m_database->opened() && !m_database->isInterrupted())
+ if (m_database->opened())
return;
// If the database was stopped, don't do anything and cancel queued work
- LOG(StorageAPI, "Database was stopped or interrupted - cancelling work for this transaction");
+ LOG(StorageAPI, "Database was stopped - cancelling work for this transaction");
MutexLocker locker(m_statementMutex);
m_statementQueue.clear();
m_nextStep = 0;
- // Release the unneeded callbacks, to break reference cycles.
- m_callback = 0;
- m_successCallback = 0;
- m_errorCallback = 0;
-
// The next steps should be executed only if we're on the DB thread.
if (currentThread() != database()->scriptExecutionContext()->databaseThread()->getThreadID())
return;
@@ -188,7 +183,7 @@ bool SQLTransaction::performNextStep()
m_nextStep == &SQLTransaction::cleanupAfterSuccessCallback ||
m_nextStep == &SQLTransaction::cleanupAfterTransactionErrorCallback);
- checkAndHandleClosedOrInterruptedDatabase();
+ checkAndHandleClosedDatabase();
if (m_nextStep)
(this->*m_nextStep)();
@@ -207,7 +202,7 @@ void SQLTransaction::performPendingCallback()
m_nextStep == &SQLTransaction::deliverQuotaIncreaseCallback ||
m_nextStep == &SQLTransaction::deliverSuccessCallback);
- checkAndHandleClosedOrInterruptedDatabase();
+ checkAndHandleClosedDatabase();
if (m_nextStep)
(this->*m_nextStep)();
@@ -297,7 +292,6 @@ void SQLTransaction::deliverTransactionCallback()
m_executeSqlAllowed = true;
shouldDeliverErrorCallback = !m_callback->handleEvent(m_database->scriptExecutionContext(), this);
m_executeSqlAllowed = false;
- m_callback = 0;
}
// Transaction Step 5 - If the transaction callback was null or raised an exception, jump to the error callback
@@ -465,7 +459,6 @@ void SQLTransaction::postflightAndCommit()
// If the commit failed, the transaction will still be marked as "in progress"
if (m_sqliteTransaction->inProgress()) {
- m_successCallback = 0;
m_transactionError = SQLError::create(SQLError::DATABASE_ERR, "failed to commit the transaction");
handleTransactionError(false);
return;
@@ -480,6 +473,7 @@ void SQLTransaction::postflightAndCommit()
m_database->transactionClient()->didCommitWriteTransaction(database());
// Now release our unneeded callbacks, to break reference cycles.
+ m_callback = 0;
m_errorCallback = 0;
// Transaction Step 10 - Deliver success callback, if there is one
@@ -552,10 +546,8 @@ void SQLTransaction::deliverTransactionErrorCallback()
// Transaction Step 12 - If exists, invoke error callback with the last
// error to have occurred in this transaction.
- if (m_errorCallback) {
+ if (m_errorCallback)
m_errorCallback->handleEvent(m_database->scriptExecutionContext(), m_transactionError.get());
- m_errorCallback = 0;
- }
m_nextStep = &SQLTransaction::cleanupAfterTransactionErrorCallback;
LOG(StorageAPI, "Scheduling cleanupAfterTransactionErrorCallback for transaction %p\n", this);
@@ -587,6 +579,10 @@ void SQLTransaction::cleanupAfterTransactionErrorCallback()
ASSERT(!m_database->sqliteDatabase().transactionInProgress());
m_nextStep = 0;
+ // Now release our callbacks, to break reference cycles.
+ m_callback = 0;
+ m_errorCallback = 0;
+
// Now release the lock on this database
m_database->transactionCoordinator()->releaseLock(this);
}
diff --git a/WebCore/storage/SQLTransaction.h b/WebCore/storage/SQLTransaction.h
index 2eb200b..5c62ca2 100644
--- a/WebCore/storage/SQLTransaction.h
+++ b/WebCore/storage/SQLTransaction.h
@@ -87,7 +87,7 @@ private:
void enqueueStatement(PassRefPtr<SQLStatement>);
- void checkAndHandleClosedOrInterruptedDatabase();
+ void checkAndHandleClosedDatabase();
void acquireLock();
void openTransactionAndPreflight();
diff --git a/WebCore/storage/chromium/DatabaseTrackerChromium.cpp b/WebCore/storage/chromium/DatabaseTrackerChromium.cpp
index 361e203..aad4ed9 100644
--- a/WebCore/storage/chromium/DatabaseTrackerChromium.cpp
+++ b/WebCore/storage/chromium/DatabaseTrackerChromium.cpp
@@ -174,35 +174,6 @@ unsigned long long DatabaseTracker::getMaxSizeForDatabase(const AbstractDatabase
return databaseSize + spaceAvailable;
}
-void DatabaseTracker::interruptAllDatabasesForContext(const ScriptExecutionContext* context)
-{
- Vector<RefPtr<AbstractDatabase> > openDatabases;
- {
- MutexLocker openDatabaseMapLock(m_openDatabaseMapGuard);
-
- if (!m_openDatabaseMap)
- return;
-
- DatabaseNameMap* nameMap = m_openDatabaseMap->get(context->securityOrigin());
- if (!nameMap)
- return;
-
- DatabaseNameMap::const_iterator dbNameMapEndIt = nameMap->end();
- for (DatabaseNameMap::const_iterator dbNameMapIt = nameMap->begin(); dbNameMapIt != dbNameMapEndIt; ++dbNameMapIt) {
- DatabaseSet* databaseSet = dbNameMapIt->second;
- DatabaseSet::const_iterator dbSetEndIt = databaseSet->end();
- for (DatabaseSet::const_iterator dbSetIt = databaseSet->begin(); dbSetIt != dbSetEndIt; ++dbSetIt) {
- if ((*dbSetIt)->scriptExecutionContext() == context)
- openDatabases.append(*dbSetIt);
- }
- }
- }
-
- Vector<RefPtr<AbstractDatabase> >::const_iterator openDatabasesEndIt = openDatabases.end();
- for (Vector<RefPtr<AbstractDatabase> >::const_iterator openDatabasesIt = openDatabases.begin(); openDatabasesIt != openDatabasesEndIt; ++openDatabasesIt)
- (*openDatabasesIt)->interrupt();
-}
-
}
#endif // ENABLE(DATABASE)
diff --git a/WebCore/workers/WorkerThread.cpp b/WebCore/workers/WorkerThread.cpp
index d6a1e05..96ca89b 100644
--- a/WebCore/workers/WorkerThread.cpp
+++ b/WebCore/workers/WorkerThread.cpp
@@ -30,6 +30,7 @@
#include "WorkerThread.h"
+#include "DatabaseTask.h"
#include "DedicatedWorkerContext.h"
#include "KURL.h"
#include "PlatformString.h"
@@ -40,11 +41,6 @@
#include <utility>
#include <wtf/Noncopyable.h>
-#if ENABLE(DATABASE)
-#include "DatabaseTask.h"
-#include "DatabaseTracker.h"
-#endif
-
namespace WebCore {
static Mutex& threadCountMutex()
@@ -229,10 +225,6 @@ void WorkerThread::stop()
if (m_workerContext) {
m_workerContext->script()->forbidExecution(WorkerScriptController::TerminateRunningScript);
-#if ENABLE(DATABASE)
- DatabaseTracker::tracker().interruptAllDatabasesForContext(m_workerContext.get());
-#endif
-
// FIXME: Rudely killing the thread won't work when we allow nested workers, because they will try to post notifications of their destruction.
// This can likely use the same mechanism as used for databases above.
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list