Reviewed by Brady Eidson.
authortimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 13 Feb 2008 06:04:19 +0000 (06:04 +0000)
committertimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 13 Feb 2008 06:04:19 +0000 (06:04 +0000)
commit47744b98409bc7746d610d37cf439703f6d6a4a0
tree745296c2772758c6df6aa23ee4a6d16424443b49
parent165e1cf3f65fc1f687583b8b86bc6792a93e6b93
    Reviewed by Brady Eidson.

        <rdar://problem/5652560> Can't delete database if the website that
        uses it has been opened in this session

        Close the Database on the database thread before deleting the file.
        Tested and works on Windows and Mac.

        * platform/sql/SQLiteDatabase.cpp:
        (WebCore::SQLiteDatabase::close): Assert we are on the opening thread.
        * storage/Database.cpp:
        (WebCore::Database::markAsDeletedAndClose): Unschedule any pending
        Database tasks, and start and imediate DatabaseCloseTask.
        (WebCore::Database::close): Close the SQLDatabase.
        * storage/Database.h: Renamed markAsDeleted to markAsDeletedAndClose.
        * storage/DatabaseTask.cpp:
        (WebCore::DatabaseCloseTask::DatabaseCloseTask): New task.
        (WebCore::DatabaseCloseTask::doPerformTask): Call close on the Database.
        (WebCore::DatabaseCloseTask::debugTaskName): Return "DatabaseCloseTask".
        * storage/DatabaseTask.h: Add DatabaseCloseTask.
        * storage/DatabaseTracker.cpp:
        (WebCore::DatabaseTracker::deleteDatabaseFile): Call the renamed
          markAsDeletedAndClose.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@30189 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebCore/ChangeLog
WebCore/platform/sql/SQLiteDatabase.cpp
WebCore/storage/Database.cpp
WebCore/storage/Database.h
WebCore/storage/DatabaseTask.cpp
WebCore/storage/DatabaseTask.h
WebCore/storage/DatabaseTracker.cpp