Cleanup pending transaction queue in Database.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 15 Feb 2012 07:03:43 +0000 (07:03 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 15 Feb 2012 07:03:43 +0000 (07:03 +0000)
commit9f65805b70d8bac74ffe71ea7d77e8302158345a
tree388bbb69d73f17090da4597a3027786104acf445
parentf35877f081b3f95a5e1eb9955563b8b8f5ac5a5d
Cleanup pending transaction queue in Database.
https://bugs.webkit.org/show_bug.cgi?id=75048

Patch by Hao Zheng <zhenghao@chromium.org> on 2012-02-14
Reviewed by David Levin.

Source/WebCore:

Each SQLTransaction has 3 SQLCallbackWrappers, and each of them
holds a ref to WorkerContext. As a result, if the worker thread is
stopped before all SQLTransactions are finished, the ASSERT of
m_workerContext->hasOneRef() in WorkerThread::workerThread() would fail.

No new tests.
REGRESSION(r103429) fast/workers/storage/use-same-database-in-page-and-workers.html asserts

* storage/Database.cpp:
(WebCore::Database::close): Cleanup pending transaction queue in close().
* storage/SQLCallbackWrapper.h:
(WebCore::SQLCallbackWrapper::clear):
(SafeReleaseTask): Make SafeReleaseTask a cleanup task, which is
necessary because at the time of SafeReleaseTask is performed,
WorkerRunLoop has been terminated and only runs cleanup tasks.
(WebCore::SQLCallbackWrapper::SafeReleaseTask::create):
(WebCore::SQLCallbackWrapper::SafeReleaseTask::performTask):
(WebCore::SQLCallbackWrapper::SafeReleaseTask::isCleanupTask):
(WebCore::SQLCallbackWrapper::SafeReleaseTask::SafeReleaseTask):

LayoutTests:

As crash is fixed, trun BUGWK75048 into BUGWK75111, so that we can
close 75048 and fix the timeout in 75111 for both DEBUG and RELEASE.

REGRESSION(r103429) fast/workers/storage/use-same-database-in-page-and-workers.html asserts

* platform/chromium/test_expectations.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@107784 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/platform/chromium/test_expectations.txt
Source/WebCore/ChangeLog
Source/WebCore/storage/Database.cpp
Source/WebCore/storage/SQLCallbackWrapper.h