Reviewed by Adam
http://bugs.webkit.org/show_bug.cgi?id=15976 - ASSERT/crash when SQLTransactionCallback throws an exception
* storage/SQLTransaction.cpp:
(WebCore::SQLTransaction::deliverTransactionCallback): Make a transaction error for the case where the
SQLTransactionCallback fails
(WebCore::SQLTransaction::deliverTransactionErrorCallback): Don't assert on the error callback, but null check it
and make the commit/rollback decision accordingly
LayoutTests:
Reviewed by Adam
Fix for http://bugs.webkit.org/show_bug.cgi?id=15976
* storage: Added - There will soon be an entire suite in here!
* storage/transaction_callback_exception_crash-expected.txt: Added.
* storage/transaction_callback_exception_crash.html: Added.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@27784
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2007-11-13 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Adam
+
+ Fix for http://bugs.webkit.org/show_bug.cgi?id=15976
+
+ * storage: Added - There will soon be an entire suite in here!
+ * storage/transaction_callback_exception_crash-expected.txt: Added.
+ * storage/transaction_callback_exception_crash.html: Added.
+
2007-11-13 Adam Roben <aroben@apple.com>
Add the http/tests/media directory to the Windows Skipped file
--- /dev/null
+CONSOLE MESSAGE: line 0: undefined
+If WebKit doesn't crash, this test has passed
--- /dev/null
+<html>
+<head>
+<script>
+
+if (window.layoutTestController) {
+ layoutTestController.dumpAsText();
+ layoutTestController.waitUntilDone();
+}
+
+var db = openDatabase("15976Test", "1.0", "Test for http://bugs.webkit.org/show_bug.cgi?id=15976", 1);
+db.transaction(function(tx) {
+ if (window.layoutTestController)
+ setTimeout("layoutTestController.notifyDone()", 0);
+ throw "TransactionCallbackError";
+});
+
+</script>
+</head>
+<body>
+If WebKit doesn't crash, this test has passed
+</body>
+</html>
+2007-11-13 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Adam
+
+ http://bugs.webkit.org/show_bug.cgi?id=15976 - ASSERT/crash when SQLTransactionCallback throws an exception
+
+ * storage/SQLTransaction.cpp:
+ (WebCore::SQLTransaction::deliverTransactionCallback): Make a transaction error for the case where the
+ SQLTransactionCallback fails
+ (WebCore::SQLTransaction::deliverTransactionErrorCallback): Don't assert on the error callback, but null check it
+ and make the commit/rollback decision accordingly
+
2007-11-13 Oliver Hunt <oliver@apple.com>
Reviewed by Anders.
shouldDeliverErrorCallback = true;
// Transaction Step 5 - If the transaction callback was null or raised an exception, jump to the error callback
- if (shouldDeliverErrorCallback)
+ if (shouldDeliverErrorCallback) {
+ m_transactionError = new SQLError(0, "the SQLTransactionCallback was null or threw an exception");
deliverTransactionErrorCallback();
- else
+ } else
scheduleToRunStatements();
}
void SQLTransaction::deliverTransactionErrorCallback()
{
- ASSERT(m_errorCallback);
ASSERT(m_transactionError);
// Transaction Step 11 - If the callback didn't return false, then rollback the transaction.
- if (m_errorCallback->handleEvent(m_transactionError.get()))
+ // This includes the callback not existing, returning true, or throwing an exception
+ if (!m_errorCallback || m_errorCallback->handleEvent(m_transactionError.get()))
m_shouldCommitAfterErrorCallback = false;
m_nextStep = &SQLTransaction::cleanupAfterTransactionErrorCallback;