2009-07-07 Ben Murdoch <benm@google.com>
authorjmalonzo@webkit.org <jmalonzo@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 7 Jul 2009 14:29:15 +0000 (14:29 +0000)
committerjmalonzo@webkit.org <jmalonzo@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 7 Jul 2009 14:29:15 +0000 (14:29 +0000)
commit01a33f4fd47a9d05581a5b12c23b3488c8662478
tree6e6c2981e8c369dccfd007754dbd5e7dd98ab386
parentfb367e974bfa1a274c2739982c94c7b1d9850c2f
2009-07-07  Ben Murdoch  <benm@google.com>

        Reviewed by Antti Koivisto.

        HTML5 Database becomes locked if a transaction is in progress when the page is refreshed.
        https://bugs.webkit.org/show_bug.cgi?id=25711

        Tests fix for https://bugs.webkit.org/show_bug.cgi?id=25711, where
        web storage databases could become locked until the browser is
        shut down if the page is refreshed whilst a transaction is in
        progress.

        * storage/database-lock-after-reload-expected.txt: Added.
        * storage/database-lock-after-reload.html: Added.
        * storage/resources/database-lock-after-reload-2.html: Added.

        Fix for https://bugs.webkit.org/show_bug.cgi?id=25711 where web
        storage databases could become locked until the browser is shut
        down if the page is refreshed whilst a transaction is in progress.

        Test: storage/database-lock-after-reload.html

        * storage/Database.cpp:
        (WebCore::Database::Database):
        (WebCore::Database::close): add code to inform the database thread we've closed the database.
        (WebCore::Database::performOpenAndVerify): add code to inform the database thread we've opened a database.
        * storage/Database.h:
        (WebCore::Database::opened): return true iff the underlying sqlite database has been opened but not closed.
        * storage/DatabaseThread.cpp:
        (WebCore::DatabaseThread::databaseThread): Before the database thread terminates, close any databases that ran transactions in this thread.
        (WebCore::DatabaseThread::recordDatabaseOpen): Records a database that executed a transaction in this thread.
        (WebCore::DatabaseThread::recordDatabaseClosed): Removes a database from the set of open databases.
        * storage/DatabaseThread.h:
        (WebCore::DatabaseThread::getThreadID): return the thread id for the database thread.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@45594 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/storage/database-lock-after-reload-expected.txt [new file with mode: 0644]
LayoutTests/storage/database-lock-after-reload.html [new file with mode: 0644]
LayoutTests/storage/resources/database-lock-after-reload-2.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/storage/Database.cpp
WebCore/storage/Database.h
WebCore/storage/DatabaseThread.cpp
WebCore/storage/DatabaseThread.h