Reviewed by Brady Eidson.
authortimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 9 Feb 2008 04:15:27 +0000 (04:15 +0000)
committertimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 9 Feb 2008 04:15:27 +0000 (04:15 +0000)
commit0529cc3cd0636d08009cd7a442c4f0019d8d8c3e
tree86739d8587c405d050d6852fa895d10a8eba0bcf
parent0c907385eb71688245d5e102888122564f603403
    Reviewed by Brady Eidson.

        <rdar://problem/5640896> Removing database then trying
        to recreate it causes trouble

        Added open Database support to DatabaseTracker. So any Database that
        is deleted will be marked as deleted and will fail to open any transaction
        or execute any new SQL queries.

        * storage/Database.cpp:
        (WebCore::Database::Database): Call DatabaseTracker::addOpenDatabase.
        (WebCore::Database::~Database): Call DatabaseTracker::removeOpenDatabase.
        (WebCore::Database::markAsDeleted): Set the m_deleted flag.
        (WebCore::Database::version): Return a null String if m_deleted is true.
        * storage/Database.h:
        (WebCore::Database::deleted): Return m_deleted.
        * storage/DatabaseTracker.cpp:
        (WebCore::DatabaseTracker::addOpenDatabase): Add the Database to a map of origins and names.
        (WebCore::DatabaseTracker::removeOpenDatabase): Remove the Database from the map.
        (WebCore::DatabaseTracker::deleteDatabaseFile): Call markAsDeleted on all the open Databases
          matching the origin/name.
        * storage/DatabaseTracker.h:
        * storage/SQLStatement.cpp:
        (WebCore::SQLStatement::setDatabaseDeletedError): Set the error about the user deleting the database.
        * storage/SQLStatement.h:
        * storage/SQLTransaction.cpp:
        (WebCore::SQLTransaction::executeSQL): If the Database is deleted, call setDatabaseDeletedError.
        (WebCore::SQLTransaction::openTransactionAndPreflight): Set the error about the user deleting the database
          if the Database was marked as deleted.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@30104 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebCore/ChangeLog
WebCore/storage/Database.cpp
WebCore/storage/Database.h
WebCore/storage/DatabaseTracker.cpp
WebCore/storage/DatabaseTracker.h
WebCore/storage/SQLStatement.cpp
WebCore/storage/SQLStatement.h
WebCore/storage/SQLTransaction.cpp