1. 30 Sep, 2013 1 commit
    • beidson@apple.com's avatar
      Remove IDBTracing.h. · 1367e453
      beidson@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=122118
      
      Reviewed by Alexey Proskuryakov.
      
      Global replace of "IDB_TRACE" with "LOG(StorageAPI)", and remove all notions of this header.
      
      * GNUmakefile.list.am:
      
      * Modules/indexeddb/IDBCursor.cpp:
      * Modules/indexeddb/IDBDatabase.cpp:
      * Modules/indexeddb/IDBDatabaseBackendInterface.h:
      * Modules/indexeddb/IDBFactory.cpp:
      * Modules/indexeddb/IDBIndex.cpp:
      * Modules/indexeddb/IDBObjectStore.cpp:
      * Modules/indexeddb/IDBOpenDBRequest.cpp:
      * Modules/indexeddb/IDBRequest.cpp:
      * Modules/indexeddb/IDBTracing.h: Removed.
      * Modules/indexeddb/IDBTransaction.cpp:
      * Modules/indexeddb/leveldb/IDBBackingStoreLevelDB.cpp:
      * Modules/indexeddb/leveldb/IDBCursorBackendLevelDB.cpp:
      * Modules/indexeddb/leveldb/IDBDatabaseBackendLevelDB.cpp:
      * Modules/indexeddb/leveldb/IDBFactoryBackendLevelDB.cpp:
      * Modules/indexeddb/leveldb/IDBObjectStoreBackendLevelDB.cpp:
      * Modules/indexeddb/leveldb/IDBTransactionBackendLevelDB.cpp:
      * WebCore.xcodeproj/project.pbxproj:
      * bindings/js/IDBBindingUtilities.cpp:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@156676 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      1367e453
  2. 27 Sep, 2013 1 commit
    • beidson@apple.com's avatar
      IndexedDB IDL Refactoring. · 77a081cf
      beidson@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=121996
      
      Reviewed by Alexey Proskuryakov.
      
      This includes:
      1 - Leveraging EventTarget.idl inheritance
      2 - Removing comments
      3 - Reordering to match the spec's IDLs
      4 - Removing nonstandard, WebKit-specific methods
      5 - Updating interfaces to match the spec (versions are only uint64_t's now...)
      6 - Updating implementation code as needed (versions are only uint64_t's now...)
      
      IDL changes:
      * Modules/indexeddb/IDBCursor.idl:
      * Modules/indexeddb/IDBDatabase.idl:
      * Modules/indexeddb/IDBFactory.idl:
      * Modules/indexeddb/IDBIndex.idl:
      * Modules/indexeddb/IDBKeyRange.idl:
      * Modules/indexeddb/IDBObjectStore.idl:
      * Modules/indexeddb/IDBRequest.idl:
      * Modules/indexeddb/IDBTransaction.idl:
      * Modules/indexeddb/IDBVersionChangeEvent.idl:
      
      * Modules/indexeddb/IndexedDB.h: Add new enum to represent version nullness.
      
      Adapt to new IDLs, and also refactor representation of initial, null versioning:
      * Modules/indexeddb/IDBCallbacks.h:
      (WebCore::IDBCallbacks::onBlocked):
      (WebCore::IDBCallbacks::onUpgradeNeeded):
      
      * Modules/indexeddb/IDBDatabase.cpp:
      (WebCore::IDBDatabase::version):
      (WebCore::IDBDatabase::onVersionChange):
      * Modules/indexeddb/IDBDatabase.h:
      
      * Modules/indexeddb/IDBDatabaseCallbacks.h:
      * Modules/indexeddb/IDBDatabaseCallbacksImpl.cpp:
      (WebCore::IDBDatabaseCallbacksImpl::onVersionChange):
      * Modules/indexeddb/IDBDatabaseCallbacksImpl.h:
      
      * Modules/indexeddb/IDBFactory.cpp:
      (WebCore::IDBFactory::open):
      (WebCore::IDBFactory::openInternal):
      (WebCore::IDBFactory::deleteDatabase):
      * Modules/indexeddb/IDBFactory.h:
      
      * Modules/indexeddb/IDBMetadata.h:
      (WebCore::IDBDatabaseMetadata::IDBDatabaseMetadata):
      
      * Modules/indexeddb/IDBOpenDBRequest.cpp:
      (WebCore::IDBOpenDBRequest::create):
      (WebCore::IDBOpenDBRequest::IDBOpenDBRequest):
      (WebCore::IDBOpenDBRequest::onBlocked):
      (WebCore::IDBOpenDBRequest::onUpgradeNeeded):
      * Modules/indexeddb/IDBOpenDBRequest.h:
      
      * Modules/indexeddb/IDBRequest.cpp:
      * Modules/indexeddb/IDBRequest.h:
      
      * Modules/indexeddb/IDBTransaction.cpp:
      * Modules/indexeddb/IDBTransaction.h:
      
      * Modules/indexeddb/IDBVersionChangeEvent.cpp:
      (WebCore::IDBVersionChangeEvent::IDBVersionChangeEvent):
      * Modules/indexeddb/IDBVersionChangeEvent.h:
      (WebCore::IDBVersionChangeEvent::create):
      (WebCore::IDBVersionChangeEvent::oldVersion):
      (WebCore::IDBVersionChangeEvent::newVersion):
      
      Keep leveldb building with minimal adaptations to the new IDLs,
      but note that the LevelDB implementation is now incompatible with the spec:
      * Modules/indexeddb/leveldb/IDBBackingStoreLevelDB.cpp:
      (WebCore::IDBBackingStore::getIDBDatabaseMetaData):
      (WebCore::objectStoreCursorOptions):
      (WebCore::indexCursorOptions):
      
      * Modules/indexeddb/leveldb/IDBDatabaseBackendLevelDB.cpp:
      (WebCore::IDBDatabaseBackendLevelDB::IDBDatabaseBackendLevelDB):
      (WebCore::IDBDatabaseBackendLevelDB::openInternal):
      (WebCore::IDBDatabaseBackendLevelDB::VersionChangeOperation::perform):
      (WebCore::IDBDatabaseBackendLevelDB::processPendingCalls):
      (WebCore::IDBDatabaseBackendLevelDB::openConnection):
      (WebCore::IDBDatabaseBackendLevelDB::runIntVersionChangeTransaction):
      (WebCore::IDBDatabaseBackendLevelDB::deleteDatabase):
      (WebCore::IDBDatabaseBackendLevelDB::deleteDatabaseFinal):
      (WebCore::IDBDatabaseBackendLevelDB::VersionChangeAbortOperation::perform):
      
      * Modules/indexeddb/leveldb/IDBLevelDBCoding.cpp:
      (WebCore::IDBLevelDBCoding::compareEncodedIDBKeys):
      
      * inspector/InspectorIndexedDBAgent.cpp: Update for metadata change.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@156590 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      77a081cf
  3. 21 Sep, 2013 1 commit
  4. 21 Mar, 2013 1 commit
    • jsbell@chromium.org's avatar
      IndexedDB: Ensure all API methods have IDB_TRACE macros · 49ac829d
      jsbell@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=112963
      
      Reviewed by Tony Chang.
      
      Anntotate methods and callbacks that weren't already annotated
      with IDB_TRACE macros to assist in debugging, e.g. when using
      the chromium port's chrome://tracing visualization.
      
      No new tests - just harmless diagnostic sprinkles.
      
      * Modules/indexeddb/IDBDatabase.cpp:
      (WebCore::IDBDatabase::createObjectStore): Added IDB_TRACE macro call here.
      (WebCore::IDBDatabase::deleteObjectStore): ...and here.
      (WebCore::IDBDatabase::transaction): ...etc.
      (WebCore::IDBDatabase::close):
      (WebCore::IDBDatabase::onVersionChange):
      * Modules/indexeddb/IDBFactory.cpp:
      (WebCore::IDBFactory::getDatabaseNames):
      (WebCore::IDBFactory::open):
      (WebCore::IDBFactory::deleteDatabase):
      * Modules/indexeddb/IDBFactoryBackendImpl.cpp:
      (WebCore::IDBFactoryBackendImpl::getDatabaseNames):
      (WebCore::IDBFactoryBackendImpl::deleteDatabase):
      (WebCore::IDBFactoryBackendImpl::open):
      * Modules/indexeddb/IDBOpenDBRequest.cpp:
      (WebCore::IDBOpenDBRequest::onBlocked):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146527 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      49ac829d
  5. 29 Jan, 2013 1 commit
    • alecflett@chromium.org's avatar
      IndexedDB: Pass metadata in to IDBOpenDBRequest.onUpgradeNeeded/onSuccess · 83c5dabe
      alecflett@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=103920
      
      Reviewed by Dimitri Glazkov.
      
      Source/WebCore:
      
      Update IDBCallbacks::onSuccess and IDBCallbacks::onUpgradeNeeded to
      pass through a metadata parameter. While there, remove the unused
      IDBTransactionBackendInterface parameter to onUpgradeNeeded.
      
      As this is another step in the IDB refactor, I've simplified future cleanup
      work by making the WebKit API code still use the old API. This
      will make it possible to outright remove code on the chromium side rather
      than another three-step checkin.
      
      No new tests, as this is more refactoring.
      
      * Modules/indexeddb/IDBCallbacks.h:
      (WebCore::IDBCallbacks::onUpgradeNeeded): new method signature.
      (WebCore::IDBCallbacks::onSuccess): new method signature.
      * Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
      (WebCore::IDBDatabaseBackendImpl::VersionChangeOperation::perform):
      (WebCore::IDBDatabaseBackendImpl::processPendingCalls):
      (WebCore::IDBDatabaseBackendImpl::openConnection):
      * Modules/indexeddb/IDBOpenDBRequest.cpp:
      (WebCore::IDBOpenDBRequest::onUpgradeNeeded): use passed-in metadata.
      (WebCore::IDBOpenDBRequest::onSuccess): use passed-in metadata.
      * Modules/indexeddb/IDBOpenDBRequest.h:
      (IDBOpenDBRequest):
      
      Source/WebKit/chromium:
      
      Support the new IDBCallbacks::onSuccess and IDBCallbacks::onUpgradeNeeded
      while maintaining chromium compatibility by shimming in the old API
      in the WebKit side. Future code will clean this up so that it is just a
      pass-through as it was before.
      
      * public/WebIDBCallbacks.h:
      (WebKit):
      (WebKit::WebIDBCallbacks::onSuccess): new method signature.
      (WebKit::WebIDBCallbacks::onUpgradeNeeded): new method signature.
      * src/IDBCallbacksProxy.cpp:
      (WebKit::IDBCallbacksProxy::onSuccess): call on new method signature proxies through old API.
      (WebKit):
      (WebKit::IDBCallbacksProxy::onUpgradeNeeded): call on new method signature proxies through old API.
      * src/IDBCallbacksProxy.h:
      (IDBCallbacksProxy):
      * src/WebIDBCallbacksImpl.cpp:
      (WebKit::WebIDBCallbacksImpl::onSuccess): call on old WebKit proxy signature calls new API.
      (WebKit):
      (WebKit::WebIDBCallbacksImpl::onUpgradeNeeded): call on old WebKit proxy signature calls new API.
      * src/WebIDBCallbacksImpl.h:
      (WebIDBCallbacksImpl):
      * tests/IDBAbortOnCorruptTest.cpp: new method signature.
      (WebCore::MockIDBCallbacks::onSuccess):
      * tests/IDBDatabaseBackendTest.cpp: new method signature.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141142 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      83c5dabe
  6. 28 Jan, 2013 3 commits
    • commit-queue@webkit.org's avatar
      Unreviewed, rolling out r141049. · 3adc597c
      commit-queue@webkit.org authored
      http://trac.webkit.org/changeset/141049
      https://bugs.webkit.org/show_bug.cgi?id=108151
      
      Caused some indexed tests to crash. (Requested by keishi on
      #webkit).
      
      Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2013-01-28
      
      Source/WebCore:
      
      * Modules/indexeddb/IDBCallbacks.h:
      (WebCore::IDBCallbacks::onUpgradeNeeded):
      (WebCore::IDBCallbacks::onSuccess):
      * Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
      (WebCore::IDBDatabaseBackendImpl::VersionChangeOperation::perform):
      (WebCore::IDBDatabaseBackendImpl::processPendingCalls):
      (WebCore::IDBDatabaseBackendImpl::openConnection):
      * Modules/indexeddb/IDBOpenDBRequest.cpp:
      (WebCore::IDBOpenDBRequest::onUpgradeNeeded):
      (WebCore::IDBOpenDBRequest::onSuccess):
      * Modules/indexeddb/IDBOpenDBRequest.h:
      (IDBOpenDBRequest):
      
      Source/WebKit/chromium:
      
      * public/WebIDBCallbacks.h:
      (WebKit):
      * src/IDBCallbacksProxy.cpp:
      (WebKit::IDBCallbacksProxy::onUpgradeNeeded):
      * src/IDBCallbacksProxy.h:
      (IDBCallbacksProxy):
      * src/WebIDBCallbacksImpl.cpp:
      (WebKit::WebIDBCallbacksImpl::onSuccess):
      (WebKit::WebIDBCallbacksImpl::onUpgradeNeeded):
      * src/WebIDBCallbacksImpl.h:
      (WebIDBCallbacksImpl):
      * tests/IDBAbortOnCorruptTest.cpp:
      (WebCore::MockIDBCallbacks::onSuccess):
      * tests/IDBDatabaseBackendTest.cpp:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141058 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      3adc597c
    • alecflett@chromium.org's avatar
      IndexedDB: Pass metadata in to IDBOpenDBRequest.onUpgradeNeeded/onSuccess · a5b12aca
      alecflett@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=103920
      
      Reviewed by Dimitri Glazkov.
      
      Source/WebCore:
      
      Update IDBCallbacks::onSuccess and IDBCallbacks::onUpgradeNeeded to
      pass through a metadata parameter. While there, remove the unused
      IDBTransactionBackendInterface parameter to onUpgradeNeeded.
      
      As this is another step in the IDB refactor, I've simplified future cleanup
      work by making the WebKit API code still use the old API. This
      will make it possible to outright remove code on the chromium side rather
      than another three-step checkin.
      
      No new tests, as this is more refactoring.
      
      * Modules/indexeddb/IDBCallbacks.h:
      (WebCore::IDBCallbacks::onUpgradeNeeded): new method signature.
      (WebCore::IDBCallbacks::onSuccess): new method signature.
      * Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
      (WebCore::IDBDatabaseBackendImpl::VersionChangeOperation::perform):
      (WebCore::IDBDatabaseBackendImpl::processPendingCalls):
      (WebCore::IDBDatabaseBackendImpl::openConnection):
      * Modules/indexeddb/IDBOpenDBRequest.cpp:
      (WebCore::IDBOpenDBRequest::onUpgradeNeeded): use passed-in metadata.
      (WebCore::IDBOpenDBRequest::onSuccess): use passed-in metadata.
      * Modules/indexeddb/IDBOpenDBRequest.h:
      (IDBOpenDBRequest):
      
      Source/WebKit/chromium:
      
      Support the new IDBCallbacks::onSuccess and IDBCallbacks::onUpgradeNeeded
      while maintaining chromium compatibility by shimming in the old API
      in the WebKit side. Future code will clean this up so that it is just a
      pass-through as it was before.
      
      * public/WebIDBCallbacks.h:
      (WebKit):
      (WebKit::WebIDBCallbacks::onSuccess): new method signature.
      (WebKit::WebIDBCallbacks::onUpgradeNeeded): new method signature.
      * src/IDBCallbacksProxy.cpp:
      (WebKit::IDBCallbacksProxy::onSuccess): call on new method signature proxies through old API.
      (WebKit):
      (WebKit::IDBCallbacksProxy::onUpgradeNeeded): call on new method signature proxies through old API.
      * src/IDBCallbacksProxy.h:
      (IDBCallbacksProxy):
      * src/WebIDBCallbacksImpl.cpp:
      (WebKit::WebIDBCallbacksImpl::onSuccess): call on old WebKit proxy signature calls new API.
      (WebKit):
      (WebKit::WebIDBCallbacksImpl::onUpgradeNeeded): call on old WebKit proxy signature calls new API.
      * src/WebIDBCallbacksImpl.h:
      (WebIDBCallbacksImpl):
      * tests/IDBAbortOnCorruptTest.cpp: new method signature.
      (WebCore::MockIDBCallbacks::onSuccess):
      * tests/IDBDatabaseBackendTest.cpp: new method signature.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141049 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      a5b12aca
    • commit-queue@webkit.org's avatar
      Unreviewed, rolling out r140934, r140935, and r140937. · 1b629091
      commit-queue@webkit.org authored
      http://trac.webkit.org/changeset/140934
      http://trac.webkit.org/changeset/140935
      http://trac.webkit.org/changeset/140937
      https://bugs.webkit.org/show_bug.cgi?id=108117
      
      Re-land some speculative rollouts - see wkbug.com/108048 for
      context (Requested by jsbell on #webkit).
      
      Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2013-01-28
      
      Source/WebCore:
      
      * CMakeLists.txt:
      * DerivedSources.make:
      * GNUmakefile.list.am:
      * Modules/indexeddb/IDBCallbacks.h:
      (IDBCallbacks):
      * Modules/indexeddb/IDBCursorBackendImpl.cpp:
      (WebCore::IDBCursorBackendImpl::IDBCursorBackendImpl):
      * Modules/indexeddb/IDBCursorBackendImpl.h:
      (WebCore::IDBCursorBackendImpl::create):
      (IDBCursorBackendImpl):
      * Modules/indexeddb/IDBDatabase.cpp:
      (WebCore::IDBDatabase::onVersionChange):
      * Modules/indexeddb/IDBDatabase.h:
      * Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
      (WebCore::IDBDatabaseBackendImpl::setIndexesReady):
      (WebCore::OpenCursorOperation::perform):
      (WebCore::IDBDatabaseBackendImpl::deleteDatabase):
      * Modules/indexeddb/IDBFactory.cpp:
      (WebCore::IDBFactory::openInternal):
      (WebCore::IDBFactory::deleteDatabase):
      * Modules/indexeddb/IDBFactory.h:
      (WebCore):
      (IDBFactory):
      * Modules/indexeddb/IDBFactory.idl:
      * Modules/indexeddb/IDBObjectStore.cpp:
      (WebCore::IDBObjectStore::createIndex):
      (WebCore::IDBObjectStore::openCursor):
      * Modules/indexeddb/IDBObjectStore.h:
      (WebCore::IDBObjectStore::openCursor):
      (IDBObjectStore):
      * Modules/indexeddb/IDBOpenDBRequest.cpp:
      (WebCore::IDBOpenDBRequest::create):
      (WebCore::IDBOpenDBRequest::IDBOpenDBRequest):
      (WebCore::IDBOpenDBRequest::onBlocked):
      (WebCore::IDBOpenDBRequest::onUpgradeNeeded):
      (WebCore::IDBOpenDBRequest::dispatchEvent):
      * Modules/indexeddb/IDBOpenDBRequest.h:
      (IDBOpenDBRequest):
      * Modules/indexeddb/IDBRequest.cpp:
      (WebCore::IDBRequest::create):
      (WebCore::IDBRequest::IDBRequest):
      * Modules/indexeddb/IDBRequest.h:
      (IDBRequest):
      (WebCore::IDBRequest::taskType):
      * Modules/indexeddb/IDBTransactionBackendImpl.cpp:
      (WebCore::IDBTransactionBackendImpl::scheduleTask):
      * Modules/indexeddb/IDBTransactionBackendImpl.h:
      (WebCore::IDBTransactionBackendImpl::scheduleTask):
      (IDBTransactionBackendImpl):
      * Modules/indexeddb/IDBTransactionBackendInterface.h:
      * Modules/indexeddb/IDBUpgradeNeededEvent.cpp: Removed.
      * Modules/indexeddb/IDBUpgradeNeededEvent.h: Removed.
      * Modules/indexeddb/IDBUpgradeNeededEvent.idl: Removed.
      * Modules/indexeddb/IDBVersionChangeEvent.cpp:
      (WebCore::IDBVersionChangeEvent::create):
      (WebCore::IDBVersionChangeEvent::IDBVersionChangeEvent):
      * Modules/indexeddb/IDBVersionChangeEvent.h:
      (IDBVersionChangeEvent):
      (WebCore::IDBVersionChangeEvent::oldVersion):
      (WebCore::IDBVersionChangeEvent::newVersion):
      * Modules/indexeddb/IDBVersionChangeEvent.idl:
      * Modules/indexeddb/IDBVersionChangeRequest.cpp: Removed.
      * Modules/indexeddb/IDBVersionChangeRequest.h: Removed.
      * Modules/indexeddb/IDBVersionChangeRequest.idl: Removed.
      * WebCore.gypi:
      * WebCore.xcodeproj/project.pbxproj:
      * dom/EventNames.in:
      * dom/EventTarget.h:
      (WebCore):
      * dom/EventTargetFactory.in:
      
      Source/WebKit/chromium:
      
      * public/WebIDBCallbacks.h:
      (WebIDBCallbacks):
      * src/AssertMatchingEnums.cpp:
      * src/IDBCallbacksProxy.cpp:
      * src/IDBCallbacksProxy.h:
      (IDBCallbacksProxy):
      * src/WebIDBCallbacksImpl.cpp:
      * src/WebIDBCallbacksImpl.h:
      (WebIDBCallbacksImpl):
      * tests/IDBAbortOnCorruptTest.cpp:
      * tests/IDBDatabaseBackendTest.cpp:
      
      LayoutTests:
      
      * storage/indexeddb/delete-in-upgradeneeded-close-in-open-success-expected.txt:
      * storage/indexeddb/delete-in-upgradeneeded-close-in-versionchange-expected.txt:
      * storage/indexeddb/deletedatabase-blocked-expected.txt:
      * storage/indexeddb/deletedatabase-delayed-by-open-and-versionchange-expected.txt:
      * storage/indexeddb/deletedatabase-delayed-by-open-and-versionchange-workers-expected.txt:
      * storage/indexeddb/deletedatabase-delayed-by-versionchange-expected.txt:
      * storage/indexeddb/deletedatabase-not-blocked-expected.txt:
      * storage/indexeddb/events-expected.txt: Added.
      * storage/indexeddb/events.html: Added.
      * storage/indexeddb/intversion-gated-on-delete-expected.txt:
      * storage/indexeddb/intversion-long-queue-expected.txt:
      * storage/indexeddb/intversion-upgrades-expected.txt:
      * storage/indexeddb/removed-expected.txt:
      * storage/indexeddb/resources/delete-in-upgradeneeded-close-in-open-success.js:
      (versionChangeCallback):
      * storage/indexeddb/resources/delete-in-upgradeneeded-close-in-versionchange.js:
      (versionChangeCallback):
      * storage/indexeddb/resources/deletedatabase-blocked.js:
      (test.request.onsuccess.openOnSuccess.h.onversionchange):
      * storage/indexeddb/resources/deletedatabase-delayed-by-open-and-versionchange.js:
      (prepareDatabase.h.onversionchange):
      * storage/indexeddb/resources/deletedatabase-delayed-by-versionchange.js:
      (h1OpenSuccess.h1.onversionchange.h1OnVersionChange.h1.onversionchange):
      (h1OpenSuccess.h1.onversionchange):
      (h1OpenSuccess.request.onsuccess.h2OpenSuccess.h2.onversionchange):
      * storage/indexeddb/resources/deletedatabase-not-blocked.js:
      (test.request.onsuccess.openOnSuccess.h.onversionchange):
      * storage/indexeddb/resources/events.js: Added.
      (test):
      * storage/indexeddb/resources/intversion-gated-on-delete.js:
      (firstSuccessCallback):
      (connection1VersionChangeCallback):
      * storage/indexeddb/resources/intversion-long-queue.js:
      (connection1VersionChangeCallback):
      (deleteDatabaseBlockedCallback):
      (deleteDatabaseSuccessCallback):
      (connection2VersionChangeEvent):
      * storage/indexeddb/resources/removed.js:
      (test):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141013 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      1b629091
  7. 27 Jan, 2013 3 commits
    • commit-queue@webkit.org's avatar
      Unreviewed, rolling out r140602. · 6935ae64
      commit-queue@webkit.org authored
      http://trac.webkit.org/changeset/140602
      https://bugs.webkit.org/show_bug.cgi?id=108045
      
      Caused 8 indexed tests to crash. (Requested by keishi on
      #webkit).
      
      Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2013-01-27
      
      Source/WebCore:
      
      * CMakeLists.txt:
      * DerivedSources.make:
      * GNUmakefile.list.am:
      * Modules/indexeddb/IDBCallbacks.h:
      (WebCore::IDBCallbacks::onBlocked):
      * Modules/indexeddb/IDBDatabase.cpp:
      * Modules/indexeddb/IDBDatabase.h:
      (WebCore):
      * Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
      (WebCore::IDBDatabaseBackendImpl::deleteDatabase):
      * Modules/indexeddb/IDBFactory.cpp:
      (WebCore::IDBFactory::openInternal):
      (WebCore::IDBFactory::deleteDatabase):
      * Modules/indexeddb/IDBFactory.h:
      (WebCore):
      (IDBFactory):
      * Modules/indexeddb/IDBFactory.idl:
      * Modules/indexeddb/IDBOpenDBRequest.cpp:
      (WebCore::IDBOpenDBRequest::create):
      (WebCore::IDBOpenDBRequest::IDBOpenDBRequest):
      (WebCore::IDBOpenDBRequest::dispatchEvent):
      * Modules/indexeddb/IDBOpenDBRequest.h:
      (IDBOpenDBRequest):
      * Modules/indexeddb/IDBVersionChangeRequest.cpp: Copied from Source/WebKit/chromium/src/WebIDBCallbacksImpl.h.
      (WebCore):
      (WebCore::IDBVersionChangeRequest::create):
      (WebCore::IDBVersionChangeRequest::IDBVersionChangeRequest):
      (WebCore::IDBVersionChangeRequest::~IDBVersionChangeRequest):
      (WebCore::IDBVersionChangeRequest::interfaceName):
      (WebCore::IDBVersionChangeRequest::onBlocked):
      * Modules/indexeddb/IDBVersionChangeRequest.h: Copied from Source/WebCore/Modules/indexeddb/IDBFactory.idl.
      (WebCore):
      (IDBVersionChangeRequest):
      * Modules/indexeddb/IDBVersionChangeRequest.idl: Copied from Source/WebCore/Modules/indexeddb/IDBFactory.idl.
      * WebCore.gypi:
      * WebCore.xcodeproj/project.pbxproj:
      * dom/EventTarget.h:
      (WebCore):
      * dom/EventTargetFactory.in:
      
      Source/WebKit/chromium:
      
      * public/WebIDBCallbacks.h:
      * src/IDBCallbacksProxy.cpp:
      (WebKit::IDBCallbacksProxy::onBlocked):
      (WebKit):
      * src/IDBCallbacksProxy.h:
      (IDBCallbacksProxy):
      * src/WebIDBCallbacksImpl.cpp:
      (WebKit::WebIDBCallbacksImpl::onBlocked):
      (WebKit):
      * src/WebIDBCallbacksImpl.h:
      (WebIDBCallbacksImpl):
      * tests/IDBAbortOnCorruptTest.cpp:
      (WebCore::MockIDBCallbacks::onBlocked):
      * tests/IDBDatabaseBackendTest.cpp:
      
      LayoutTests:
      
      * storage/indexeddb/intversion-long-queue-expected.txt:
      * storage/indexeddb/intversion-upgrades-expected.txt:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140937 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      6935ae64
    • keishi@webkit.org's avatar
      Unreviewed, rolling out r140850. · 3511647f
      keishi@webkit.org authored
      http://trac.webkit.org/changeset/140850
      https://bugs.webkit.org/show_bug.cgi?id=107960
      
      r14602 caused 8 indexed tests to crash.
      
      Source/WebCore:
      
      * Modules/indexeddb/IDBCursorBackendImpl.cpp:
      (WebCore::IDBCursorBackendImpl::IDBCursorBackendImpl):
      * Modules/indexeddb/IDBCursorBackendImpl.h:
      (WebCore::IDBCursorBackendImpl::create):
      (IDBCursorBackendImpl):
      * Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
      (WebCore::IDBDatabaseBackendImpl::setIndexesReady):
      (WebCore::OpenCursorOperation::perform):
      * Modules/indexeddb/IDBObjectStore.cpp:
      (WebCore::IDBObjectStore::createIndex):
      (WebCore::IDBObjectStore::openCursor):
      * Modules/indexeddb/IDBObjectStore.h:
      (WebCore::IDBObjectStore::openCursor):
      (IDBObjectStore):
      * Modules/indexeddb/IDBOpenDBRequest.cpp:
      (WebCore::IDBOpenDBRequest::IDBOpenDBRequest):
      * Modules/indexeddb/IDBRequest.cpp:
      (WebCore::IDBRequest::create):
      (WebCore::IDBRequest::IDBRequest):
      * Modules/indexeddb/IDBRequest.h:
      (IDBRequest):
      (WebCore::IDBRequest::taskType):
      * Modules/indexeddb/IDBTransactionBackendImpl.cpp:
      (WebCore::IDBTransactionBackendImpl::scheduleTask):
      * Modules/indexeddb/IDBTransactionBackendImpl.h:
      (WebCore::IDBTransactionBackendImpl::scheduleTask):
      (IDBTransactionBackendImpl):
      * Modules/indexeddb/IDBTransactionBackendInterface.h:
      (IDBTransactionBackendInterface):
      
      Source/WebKit/chromium:
      
      * src/AssertMatchingEnums.cpp:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140935 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      3511647f
    • commit-queue@webkit.org's avatar
      Unreviewed, rolling out r140741. · 946db2c5
      commit-queue@webkit.org authored
      http://trac.webkit.org/changeset/140741
      https://bugs.webkit.org/show_bug.cgi?id=108044
      
      Caused 8 indexed tests to fail on Mac and Win. (Requested by
      keishi on #webkit).
      
      Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2013-01-27
      
      Source/WebCore:
      
      * CMakeLists.txt:
      * GNUmakefile.list.am:
      * Modules/indexeddb/IDBDatabase.cpp:
      (WebCore::IDBDatabase::onVersionChange):
      * Modules/indexeddb/IDBFactory.cpp:
      (WebCore::IDBFactory::deleteDatabase):
      * Modules/indexeddb/IDBOpenDBRequest.cpp:
      (WebCore::IDBOpenDBRequest::onBlocked):
      (WebCore::IDBOpenDBRequest::onUpgradeNeeded):
      * Modules/indexeddb/IDBUpgradeNeededEvent.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBVersionChangeEvent.cpp.
      (WebCore):
      (WebCore::IDBUpgradeNeededEvent::create):
      (WebCore::IDBUpgradeNeededEvent::IDBUpgradeNeededEvent):
      (WebCore::IDBUpgradeNeededEvent::~IDBUpgradeNeededEvent):
      (WebCore::IDBUpgradeNeededEvent::oldVersion):
      (WebCore::IDBUpgradeNeededEvent::newVersion):
      (WebCore::IDBUpgradeNeededEvent::interfaceName):
      * Modules/indexeddb/IDBUpgradeNeededEvent.h: Copied from Source/WebCore/Modules/indexeddb/IDBVersionChangeEvent.h.
      (WebCore):
      (IDBUpgradeNeededEvent):
      * Modules/indexeddb/IDBUpgradeNeededEvent.idl: Copied from Source/WebCore/Modules/indexeddb/IDBVersionChangeEvent.idl.
      * Modules/indexeddb/IDBVersionChangeEvent.cpp:
      (WebCore::IDBVersionChangeEvent::create):
      (WebCore::IDBVersionChangeEvent::IDBVersionChangeEvent):
      (WebCore::IDBVersionChangeEvent::version):
      (WebCore):
      * Modules/indexeddb/IDBVersionChangeEvent.h:
      (WebCore):
      (IDBVersionChangeEvent):
      * Modules/indexeddb/IDBVersionChangeEvent.idl:
      * WebCore.gypi:
      * dom/EventNames.in:
      
      LayoutTests:
      
      * storage/indexeddb/delete-in-upgradeneeded-close-in-open-success-expected.txt:
      * storage/indexeddb/delete-in-upgradeneeded-close-in-versionchange-expected.txt:
      * storage/indexeddb/deletedatabase-blocked-expected.txt:
      * storage/indexeddb/deletedatabase-delayed-by-open-and-versionchange-expected.txt:
      * storage/indexeddb/deletedatabase-delayed-by-open-and-versionchange-workers-expected.txt:
      * storage/indexeddb/deletedatabase-delayed-by-versionchange-expected.txt:
      * storage/indexeddb/deletedatabase-not-blocked-expected.txt:
      * storage/indexeddb/events-expected.txt: Removed.
      * storage/indexeddb/events.html: Removed.
      * storage/indexeddb/intversion-gated-on-delete-expected.txt:
      * storage/indexeddb/intversion-long-queue-expected.txt:
      * storage/indexeddb/removed-expected.txt:
      * storage/indexeddb/resources/delete-in-upgradeneeded-close-in-open-success.js:
      (versionChangeCallback):
      * storage/indexeddb/resources/delete-in-upgradeneeded-close-in-versionchange.js:
      (versionChangeCallback):
      * storage/indexeddb/resources/deletedatabase-blocked.js:
      (test.request.onsuccess.openOnSuccess.h.onversionchange):
      * storage/indexeddb/resources/deletedatabase-delayed-by-open-and-versionchange.js:
      (prepareDatabase.h.onversionchange):
      * storage/indexeddb/resources/deletedatabase-delayed-by-versionchange.js:
      (h1OpenSuccess.h1.onversionchange):
      (h1OpenSuccess.request.onsuccess.h2OpenSuccess.h2.onversionchange):
      * storage/indexeddb/resources/deletedatabase-not-blocked.js:
      (test.request.onsuccess.openOnSuccess.h.onversionchange):
      * storage/indexeddb/resources/events.js: Removed.
      * storage/indexeddb/resources/intversion-gated-on-delete.js:
      (firstSuccessCallback):
      (connection1VersionChangeCallback):
      * storage/indexeddb/resources/intversion-long-queue.js:
      (connection1VersionChangeCallback):
      (deleteDatabaseBlockedCallback):
      (deleteDatabaseSuccessCallback):
      (connection2VersionChangeEvent):
      * storage/indexeddb/resources/removed.js:
      (test):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140934 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      946db2c5
  8. 25 Jan, 2013 1 commit
    • alecflett@chromium.org's avatar
      IndexedDB: Move TaskType enum to IDBDatabaseBackendInterface · b77ab0a4
      alecflett@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=107960
      
      Reviewed by Tony Chang.
      
      Source/WebCore:
      
      The IDBTransactionBackendInterface class is going away,
      this is an easy search-and-replace patch to keep these
      changes out of more complex patches.
      
      No new tests, just part of a refactor.
      
      * Modules/indexeddb/IDBCursorBackendImpl.cpp:
      (WebCore::IDBCursorBackendImpl::IDBCursorBackendImpl):
      * Modules/indexeddb/IDBCursorBackendImpl.h:
      (WebCore::IDBCursorBackendImpl::create):
      (IDBCursorBackendImpl):
      * Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
      (WebCore::IDBDatabaseBackendImpl::setIndexesReady):
      (WebCore::OpenCursorOperation::perform):
      * Modules/indexeddb/IDBObjectStore.cpp:
      (WebCore::IDBObjectStore::createIndex):
      (WebCore::IDBObjectStore::openCursor):
      * Modules/indexeddb/IDBObjectStore.h:
      (WebCore::IDBObjectStore::openCursor):
      (IDBObjectStore):
      * Modules/indexeddb/IDBOpenDBRequest.cpp:
      (WebCore::IDBOpenDBRequest::IDBOpenDBRequest):
      * Modules/indexeddb/IDBRequest.cpp:
      (WebCore::IDBRequest::create):
      (WebCore::IDBRequest::IDBRequest):
      * Modules/indexeddb/IDBRequest.h:
      (IDBRequest):
      (WebCore::IDBRequest::taskType):
      * Modules/indexeddb/IDBTransactionBackendImpl.cpp:
      (WebCore::IDBTransactionBackendImpl::scheduleTask):
      * Modules/indexeddb/IDBTransactionBackendImpl.h:
      (WebCore::IDBTransactionBackendImpl::scheduleTask):
      (IDBTransactionBackendImpl):
      * Modules/indexeddb/IDBTransactionBackendInterface.h:
      
      Source/WebKit/chromium:
      
      Update asserts to reflect new enum location.
      
      * src/AssertMatchingEnums.cpp:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140850 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      b77ab0a4
  9. 24 Jan, 2013 1 commit
    • jsbell@chromium.org's avatar
      IndexedDB: Remove IDBUpgradeNeededEvent, merge with IDBVersionChangeEvent · cd4af9db
      jsbell@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=107754
      
      Reviewed by Tony Chang.
      
      Source/WebCore:
      
      The IndexedDB spec calls deleteDatabase() to fire a "blocked" event with the
      IDBVersionChangeEvent interface which we were doing, but with an older interface - just
      a "version" property. We were already firing an event on "versionchange" with the new
      "oldVersion" and "newVersion" properties, but with an IDBUpgradeNeededEvent interface that
      doesn't exist in the spec. This patch merges the event types to match the spec, including
      that the newVersion property is null when deleting.
      
      Test: storage/indexeddb/events.html
            storage/indexeddb/deletedatabase-*.html
      
      * CMakeLists.txt: Remove references to deleted files.
      * GNUmakefile.list.am: Ditto.
      * Modules/indexeddb/IDBDatabase.cpp:
      (WebCore::IDBDatabase::onVersionChange): Generate IDBVersionChangeEvent.
      * Modules/indexeddb/IDBOpenDBRequest.cpp:
      (WebCore::IDBOpenDBRequest::onBlocked): Ditto.
      (WebCore::IDBOpenDBRequest::onUpgradeNeeded): Ditto.
      * Modules/indexeddb/IDBUpgradeNeededEvent.cpp: Removed.
      * Modules/indexeddb/IDBUpgradeNeededEvent.h: Removed.
      * Modules/indexeddb/IDBUpgradeNeededEvent.idl: Removed.
      * Modules/indexeddb/IDBVersionChangeEvent.cpp:
      (WebCore::IDBVersionChangeEvent::create): Take IDBAny's as old/new versions
      may be integers, strings (for legacy databases), or null (when deleting).
      (WebCore::IDBVersionChangeEvent::IDBVersionChangeEvent):
      * Modules/indexeddb/IDBVersionChangeEvent.h:
      (IDBVersionChangeEvent): Remove version property.
      (WebCore::IDBVersionChangeEvent::oldVersion): Added new property.
      (WebCore::IDBVersionChangeEvent::newVersion): Added new property.
      * Modules/indexeddb/IDBVersionChangeEvent.idl: Updated properties.
      * WebCore.gypi: Remove references to deleted files.
      * dom/EventNames.in: Ditto.
      
      LayoutTests:
      
      Updated expectations, and new test file. In most cases, just switch test from
      looking at event.target.version and event.version to event.oldVersion and event.newVersion,
      in some cases verifying the old properties as well as a sanity check.
      
      * storage/indexeddb/delete-in-upgradeneeded-close-in-open-success-expected.txt:
      * storage/indexeddb/delete-in-upgradeneeded-close-in-versionchange-expected.txt:
      * storage/indexeddb/deletedatabase-blocked-expected.txt:
      * storage/indexeddb/deletedatabase-delayed-by-open-and-versionchange-expected.txt:
      * storage/indexeddb/deletedatabase-delayed-by-open-and-versionchange-workers-expected.txt:
      * storage/indexeddb/deletedatabase-delayed-by-versionchange-expected.txt:
      * storage/indexeddb/deletedatabase-not-blocked-expected.txt:
      * storage/indexeddb/events-expected.txt: Added.
      * storage/indexeddb/events.html: Added.
      * storage/indexeddb/intversion-gated-on-delete-expected.txt:
      * storage/indexeddb/intversion-long-queue-expected.txt:
      * storage/indexeddb/removed-expected.txt:
      * storage/indexeddb/resources/delete-in-upgradeneeded-close-in-open-success.js:
      * storage/indexeddb/resources/deletedatabase-blocked.js:
      * storage/indexeddb/resources/deletedatabase-delayed-by-open-and-versionchange.js:
      * storage/indexeddb/resources/deletedatabase-delayed-by-versionchange.js:
      * storage/indexeddb/resources/deletedatabase-not-blocked.js:
      * storage/indexeddb/resources/events.js: Added.
      * storage/indexeddb/resources/intversion-gated-on-delete.js:
      * storage/indexeddb/resources/intversion-long-queue.js:
      * storage/indexeddb/resources/removed.js: Verify that old Event type and property are gone.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140741 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      cd4af9db
  10. 23 Jan, 2013 1 commit
    • jsbell@chromium.org's avatar
      IndexedDB: Remove IDBVersionChangeRequest · d57bce8b
      jsbell@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=107711
      
      Reviewed by Tony Chang.
      
      Source/WebCore:
      
      When the setVersion() API was removed from the Indexed DB spec the IDBVersionChangeRequest
      interface was replaced with IDBOpenDBRequest. We switched over for open(), this completes
      the work by switching over for deleteDatabase() and removing the old code. (On the Event
      side we still need to combine IDBVersionChangeEvent and IDBUpgradeNeededEvent.)
      
      Test: storage/indexeddb/intversion-long-queue.html
            storage/indexeddb/intversion-upgrades.html
      
      * CMakeLists.txt: Remove references to deleted code.
      * DerivedSources.make: Ditto.
      * GNUmakefile.list.am: Ditto.
      * Modules/indexeddb/IDBCallbacks.h: Remove unused onBlocked() overload.
      * Modules/indexeddb/IDBDatabase.cpp: Remove references to deleted code.
      * Modules/indexeddb/IDBDatabase.h: Ditto.
      * Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
      (WebCore::IDBDatabaseBackendImpl::deleteDatabase): Fire onBlocked with current version.
      * Modules/indexeddb/IDBFactory.cpp:
      (WebCore::IDBFactory::openInternal): Don't need to specify source.
      (WebCore::IDBFactory::deleteDatabase): Use an IDBOpenDBRequest.
      * Modules/indexeddb/IDBFactory.h: Change return type of deleteDatabase()
      * Modules/indexeddb/IDBFactory.idl: Ditto.
      * Modules/indexeddb/IDBOpenDBRequest.cpp:
      (WebCore::IDBOpenDBRequest::create): Always use a null source.
      (WebCore::IDBOpenDBRequest::IDBOpenDBRequest): Pass null source to base class.
      (WebCore::IDBOpenDBRequest::dispatchEvent): Don't assume result is a database in existing
      special case.
      * Modules/indexeddb/IDBOpenDBRequest.h: Don't need a source argument (always null).
      * Modules/indexeddb/IDBVersionChangeRequest.cpp: Removed.
      * Modules/indexeddb/IDBVersionChangeRequest.h: Removed.
      * Modules/indexeddb/IDBVersionChangeRequest.idl: Removed.
      * WebCore.gypi: Remove references to deleted code.
      * WebCore.xcodeproj/project.pbxproj: Remove references to deleted code.
      * dom/EventTarget.h: Remove references to deleted code.
      * dom/EventTargetFactory.in: Ditto.
      
      Source/WebKit/chromium:
      
      * public/WebIDBCallbacks.h: Note to delete onBlocked() once Chromium is cleaned up.
      * src/IDBCallbacksProxy.cpp: Remove unused onBlocked() overload.
      * src/IDBCallbacksProxy.h: Ditto.
      * src/WebIDBCallbacksImpl.cpp: Ditto.
      * src/WebIDBCallbacksImpl.h: Ditto.
      * tests/IDBAbortOnCorruptTest.cpp: Ditto.
      * tests/IDBDatabaseBackendTest.cpp: Ditto.
      
      LayoutTests:
      
      Update expectations - change a handful of FAIL to PASS because past-us were awesome.
      
      * storage/indexeddb/intversion-long-queue-expected.txt:
      * storage/indexeddb/intversion-upgrades-expected.txt:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140602 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      d57bce8b
  11. 18 Jan, 2013 1 commit
    • alecflett@chromium.org's avatar
      IndexedDB: Switch to new createTransaction call · 26393b19
      alecflett@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=107311
      
      Reviewed by Tony Chang.
      
      Source/WebCore:
      
      Convert frontend callers to use the new backend createTransaction
      call which is the final divorce between the frontend and backend
      transaction objects. This allows an asynchronous call in Chromium
      and allows the front and backend to have their own lifecycle,
      allowing the backend to be cleaned up as soon as a transaction is complete,
      rather than waiting for the JS object to get cleaned up.
      
      No new tests, this is a refactor covered by existing tests.
      
      * Modules/indexeddb/IDBDatabase.cpp:
      (WebCore::IDBDatabase::transaction):
      * Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
      (WebCore::IDBDatabaseBackendImpl::commit):
      (WebCore::IDBDatabaseBackendImpl::abort):
      (WebCore::IDBDatabaseBackendImpl::createTransaction):
      (WebCore::IDBDatabaseBackendImpl::runIntVersionChangeTransaction):
      * Modules/indexeddb/IDBDatabaseCallbacksImpl.cpp:
      (WebCore::IDBDatabaseCallbacksImpl::onAbort):
      (WebCore::IDBDatabaseCallbacksImpl::onComplete):
      * Modules/indexeddb/IDBOpenDBRequest.cpp:
      (WebCore::IDBOpenDBRequest::onUpgradeNeeded):
      * Modules/indexeddb/IDBTransaction.cpp:
      (WebCore::IDBTransaction::create):
      (WebCore::IDBTransaction::IDBTransaction):
      (WebCore::IDBTransaction::setActive):
      (WebCore::IDBTransaction::abort):
      * Modules/indexeddb/IDBTransaction.h:
      (WebCore):
      (IDBTransaction):
      * Modules/indexeddb/IDBTransactionBackendImpl.cpp:
      (WebCore::IDBTransactionBackendImpl::create):
      (WebCore::IDBTransactionBackendImpl::IDBTransactionBackendImpl):
      (WebCore::IDBTransactionBackendImpl::abort):
      (WebCore::IDBTransactionBackendImpl::commit):
      * Modules/indexeddb/IDBTransactionBackendImpl.h:
      (IDBTransactionBackendImpl):
      (WebCore::IDBTransactionBackendImpl::setCallbacks):
      
      Source/WebKit/chromium:
      
      * public/WebIDBTransaction.h:
      
      Remove an old method that nobody calls.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140219 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      26393b19
  12. 05 Dec, 2012 1 commit
    • alecflett@chromium.org's avatar
      IndexedDB: Stub out transaction-backend methods · d653faa0
      alecflett@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=103921
      
      Reviewed by Dimitri Glazkov.
      
      Source/WebCore:
      
      In preparation for a refactoring. Legacy methods
      will be removed in https://bugs.webkit.org/show_bug.cgi?id=103923.
      
      No new tests, just adding unused methods for refactoring.
      
      * Modules/indexeddb/IDBCallbacks.h:
      (WebCore::IDBCallbacks::onUpgradeNeeded):
      * Modules/indexeddb/IDBDatabase.cpp:
      (WebCore::IDBDatabase::onAbort):
      (WebCore):
      (WebCore::IDBDatabase::onComplete):
      * Modules/indexeddb/IDBDatabase.h:
      (IDBDatabase):
      * Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
      (WebCore::IDBDatabaseBackendImpl::createTransaction):
      (WebCore):
      * Modules/indexeddb/IDBDatabaseBackendImpl.h:
      (IDBDatabaseBackendImpl):
      (WebCore::IDBDatabaseBackendImpl::commit):
      (WebCore::IDBDatabaseBackendImpl::abort):
      * Modules/indexeddb/IDBDatabaseBackendInterface.h:
      (IDBDatabaseBackendInterface):
      * Modules/indexeddb/IDBDatabaseCallbacks.h:
      (IDBDatabaseCallbacks):
      * Modules/indexeddb/IDBDatabaseCallbacksImpl.cpp:
      (WebCore::IDBDatabaseCallbacksImpl::onAbort):
      (WebCore):
      (WebCore::IDBDatabaseCallbacksImpl::onComplete):
      * Modules/indexeddb/IDBDatabaseCallbacksImpl.h:
      (IDBDatabaseCallbacksImpl):
      * Modules/indexeddb/IDBFactoryBackendImpl.cpp:
      (WebCore::IDBFactoryBackendImpl::open):
      * Modules/indexeddb/IDBFactoryBackendImpl.h:
      (WebCore::IDBFactoryBackendImpl::open):
      (IDBFactoryBackendImpl):
      * Modules/indexeddb/IDBFactoryBackendInterface.h:
      (IDBFactoryBackendInterface):
      * Modules/indexeddb/IDBOpenDBRequest.cpp:
      (WebCore::IDBOpenDBRequest::onUpgradeNeeded):
      (WebCore):
      * Modules/indexeddb/IDBOpenDBRequest.h:
      (IDBOpenDBRequest):
      * Modules/indexeddb/IDBTransactionBackendInterface.h:
      (WebCore):
      * Modules/indexeddb/IDBTransactionCoordinator.h:
      
      Source/WebKit/chromium:
      
      Add new signatures for refactoring, to allow
      transaction_ids to make is through the open/onUpgradeNeeded
      loop.
      
      * public/WebIDBCallbacks.h:
      (WebKit::WebIDBCallbacks::onUpgradeNeeded):
      * public/WebIDBDatabase.h:
      (WebKit::WebIDBDatabase::createTransaction):
      (WebKit::WebIDBDatabase::abort):
      (WebKit::WebIDBDatabase::commit):
      (WebIDBDatabase):
      * public/WebIDBDatabaseCallbacks.h:
      (WebIDBDatabaseCallbacks):
      (WebKit::WebIDBDatabaseCallbacks::onAbort):
      (WebKit::WebIDBDatabaseCallbacks::onComplete):
      * public/WebIDBFactory.h:
      (WebKit::WebIDBFactory::open):
      * src/IDBCallbacksProxy.cpp:
      (WebKit::IDBCallbacksProxy::onUpgradeNeeded):
      (WebKit):
      * src/IDBCallbacksProxy.h:
      (IDBCallbacksProxy):
      * src/IDBDatabaseBackendProxy.cpp:
      (WebKit::IDBDatabaseBackendProxy::createTransaction):
      (WebKit):
      (WebKit::IDBDatabaseBackendProxy::commit):
      (WebKit::IDBDatabaseBackendProxy::abort):
      * src/IDBDatabaseBackendProxy.h:
      (IDBDatabaseBackendProxy):
      * src/IDBDatabaseCallbacksProxy.cpp:
      (WebKit::IDBDatabaseCallbacksProxy::onAbort):
      (WebKit):
      (WebKit::IDBDatabaseCallbacksProxy::onComplete):
      * src/IDBDatabaseCallbacksProxy.h:
      (IDBDatabaseCallbacksProxy):
      * src/IDBFactoryBackendProxy.cpp:
      (WebKit::IDBFactoryBackendProxy::open):
      (WebKit):
      * src/IDBFactoryBackendProxy.h:
      (IDBFactoryBackendProxy):
      * src/WebIDBCallbacksImpl.cpp:
      (WebKit::WebIDBCallbacksImpl::onUpgradeNeeded):
      (WebKit):
      * src/WebIDBCallbacksImpl.h:
      (WebIDBCallbacksImpl):
      * src/WebIDBDatabaseCallbacksImpl.cpp:
      (WebKit::WebIDBDatabaseCallbacksImpl::onAbort):
      (WebKit):
      (WebKit::WebIDBDatabaseCallbacksImpl::onComplete):
      * src/WebIDBDatabaseCallbacksImpl.h:
      (WebIDBDatabaseCallbacksImpl):
      * src/WebIDBDatabaseImpl.cpp:
      (WebKit::WebIDBDatabaseImpl::createTransaction):
      (WebKit):
      (WebKit::WebIDBDatabaseImpl::abort):
      (WebKit::WebIDBDatabaseImpl::commit):
      * src/WebIDBDatabaseImpl.h:
      (WebIDBDatabaseImpl):
      * src/WebIDBFactoryImpl.cpp:
      (WebKit::WebIDBFactoryImpl::open):
      (WebKit):
      * src/WebIDBFactoryImpl.h:
      (WebIDBFactoryImpl):
      * tests/IDBAbortOnCorruptTest.cpp:
      * tests/IDBDatabaseBackendTest.cpp:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136714 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      d653faa0
  13. 04 Dec, 2012 1 commit
    • jsbell@chromium.org's avatar
      IndexedDB: Correct database version after aborted upgrade · ef0ca77a
      jsbell@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=103763
      
      Reviewed by Tony Chang.
      
      Source/WebCore:
      
      After an aborted "versionchange" transaction, the IDBDatabase would fetch a fresh snapshot
      of the metadata from the back end. If the back end had already started a new "versionchange"
      transaction the snapshot would be bogus. Instead, save a copy of the IDBDatabase's metadata
      and roll back to that, as is done for IDBObjectStore.
      
      Tests: storage/indexeddb/intversion-abort-in-initial-upgradeneeded.html
             storage/indexeddb/mozilla/versionchange-abort.html
             storage/indexeddb/unblocked-version-changes.html
      
      * Modules/indexeddb/IDBDatabase.cpp:
      (WebCore::IDBDatabase::IDBDatabase):
      (WebCore::IDBDatabase::transactionCreated):
      * Modules/indexeddb/IDBDatabase.h:
      (WebCore::IDBDatabase::setMetadata): Let IDBOpenDBRequest and IDBTransaction tinker.
      * Modules/indexeddb/IDBOpenDBRequest.cpp:
      (WebCore::IDBOpenDBRequest::onUpgradeNeeded): Fetch new and compute old metadata.
      (WebCore::IDBOpenDBRequest::onSuccess): Fetch new metadata, in case upgrade changed it.
      * Modules/indexeddb/IDBTransaction.cpp:
      (WebCore::IDBTransaction::create): Stash the old metadata, in case of rollback.
      (WebCore::IDBTransaction::IDBTransaction):
      (WebCore::IDBTransaction::onAbort): Revert the database as well as the stores.
      * Modules/indexeddb/IDBTransaction.h:
      (IDBTransaction):
      
      Source/WebKit/chromium:
      
      Pass previously created proxy along in an open onSuccess, rather than a useless wrapper.
      
      * src/WebIDBCallbacksImpl.cpp:
      (WebKit::WebIDBCallbacksImpl::WebIDBCallbacksImpl):
      (WebKit::WebIDBCallbacksImpl::onSuccess):
      (WebKit::WebIDBCallbacksImpl::onUpgradeNeeded):
      * src/WebIDBCallbacksImpl.h:
      (WebCore):
      (WebIDBCallbacksImpl):
      
      LayoutTests:
      
      Update test expectations and tweak a test so it's testing what it claimed.
      
      * storage/indexeddb/intversion-abort-in-initial-upgradeneeded-expected.txt:
      * storage/indexeddb/mozilla/resources/versionchange-abort.js:
      (postAbort):
      * storage/indexeddb/mozilla/versionchange-abort-expected.txt:
      * storage/indexeddb/resources/unblocked-version-changes.js:
      (onUpgradeNeeded):
      * storage/indexeddb/unblocked-version-changes-expected.txt:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136475 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      ef0ca77a
  14. 03 Dec, 2012 1 commit
    • jsbell@chromium.org's avatar
      IndexedDB: Rename exception enum members from UGLY_ERR to PrettyError · e9e60209
      jsbell@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=103759
      
      Reviewed by Darin Fisher.
      
      Source/WebCore:
      
      Now that IDBDatabaseException isn't exposed to script with constants, the exception types
      can be renamed to match the much friendlier names used in newer iterations of the spec. Also
      remove the legacy/unused types.
      
      No new tests, just constant renames.
      
      * Modules/indexeddb/IDBCursor.cpp:
      (WebCore::IDBCursor::update):
      (WebCore::IDBCursor::advance):
      (WebCore::IDBCursor::continueFunction):
      (WebCore::IDBCursor::deleteFunction):
      * Modules/indexeddb/IDBCursorBackendImpl.cpp:
      (WebCore::IDBCursorBackendImpl::continueFunction):
      (WebCore::IDBCursorBackendImpl::advance):
      (WebCore::IDBCursorBackendImpl::prefetchContinue):
      * Modules/indexeddb/IDBDatabase.cpp:
      (WebCore::IDBDatabase::createObjectStore):
      (WebCore::IDBDatabase::deleteObjectStore):
      (WebCore::IDBDatabase::transaction):
      * Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
      (WebCore::IDBDatabaseBackendImpl::createObjectStore):
      (WebCore::IDBDatabaseBackendImpl::deleteObjectStore):
      (WebCore::IDBDatabaseBackendImpl::VersionChangeOperation::perform):
      (WebCore::IDBDatabaseBackendImpl::transactionFinishedAndAbortFired):
      (WebCore::IDBDatabaseBackendImpl::openConnection):
      (WebCore::IDBDatabaseBackendImpl::openConnectionWithVersion):
      (WebCore::IDBDatabaseBackendImpl::deleteDatabase):
      (WebCore::IDBDatabaseBackendImpl::close):
      * Modules/indexeddb/IDBDatabaseException.cpp: Tidying and renaming.
      (WebCore):
      (WebCore::getErrorEntry):
      * Modules/indexeddb/IDBDatabaseException.h:
      * Modules/indexeddb/IDBFactory.cpp:
      (WebCore::IDBFactory::cmp):
      * Modules/indexeddb/IDBFactoryBackendImpl.cpp:
      (WebCore::IDBFactoryBackendImpl::getDatabaseNames):
      (WebCore::IDBFactoryBackendImpl::deleteDatabase):
      (WebCore::IDBFactoryBackendImpl::open):
      * Modules/indexeddb/IDBIndex.cpp:
      (WebCore::IDBIndex::openCursor):
      (WebCore::IDBIndex::count):
      (WebCore::IDBIndex::openKeyCursor):
      (WebCore::IDBIndex::get):
      (WebCore::IDBIndex::getKey):
      * Modules/indexeddb/IDBIndexBackendImpl.cpp:
      (WebCore::IDBIndexBackendImpl::openCursor):
      (WebCore::IDBIndexBackendImpl::openKeyCursor):
      (WebCore::IDBIndexBackendImpl::count):
      (WebCore::IDBIndexBackendImpl::get):
      (WebCore::IDBIndexBackendImpl::getKey):
      * Modules/indexeddb/IDBKeyRange.cpp:
      (WebCore::IDBKeyRange::only):
      (WebCore::IDBKeyRange::lowerBound):
      (WebCore::IDBKeyRange::upperBound):
      (WebCore::IDBKeyRange::bound):
      * Modules/indexeddb/IDBObjectStore.cpp:
      (WebCore::IDBObjectStore::get):
      (WebCore::IDBObjectStore::put):
      (WebCore::IDBObjectStore::deleteFunction):
      (WebCore::IDBObjectStore::clear):
      (WebCore):
      (WebCore::IDBObjectStore::createIndex):
      (WebCore::IDBObjectStore::index):
      (WebCore::IDBObjectStore::deleteIndex):
      (WebCore::IDBObjectStore::openCursor):
      (WebCore::IDBObjectStore::count):
      * Modules/indexeddb/IDBObjectStoreBackendImpl.cpp:
      (WebCore::IDBObjectStoreBackendImpl::get):
      (WebCore::IDBObjectStoreBackendImpl::put):
      (WebCore):
      (WebCore::IDBObjectStoreBackendImpl::setIndexKeys):
      (WebCore::IDBObjectStoreBackendImpl::ObjectStoreStorageOperation::perform):
      (WebCore::IDBObjectStoreBackendImpl::deleteFunction):
      (WebCore::IDBObjectStoreBackendImpl::clear):
      (WebCore::IDBObjectStoreBackendImpl::createIndex):
      (WebCore::IDBObjectStoreBackendImpl::deleteIndex):
      (WebCore::IDBObjectStoreBackendImpl::openCursor):
      (WebCore::IDBObjectStoreBackendImpl::count):
      * Modules/indexeddb/IDBOpenDBRequest.cpp:
      (WebCore::IDBOpenDBRequest::dispatchEvent):
      * Modules/indexeddb/IDBRequest.cpp:
      (WebCore::IDBRequest::result):
      (WebCore::IDBRequest::error):
      (WebCore::IDBRequest::errorCode):
      (WebCore::IDBRequest::webkitErrorMessage):
      (WebCore::IDBRequest::abort):
      (WebCore::IDBRequest::dispatchEvent):
      (WebCore::IDBRequest::uncaughtExceptionInEventHandler):
      * Modules/indexeddb/IDBTransaction.cpp:
      (WebCore::IDBTransaction::objectStore):
      (WebCore::IDBTransaction::abort):
      * Modules/indexeddb/IDBTransactionBackendImpl.cpp:
      (WebCore::IDBTransactionBackendImpl::objectStore):
      (WebCore::IDBTransactionBackendImpl::abort):
      (WebCore::IDBTransactionBackendImpl::commit):
      
      Source/WebKit/chromium:
      
      Update IDBDatabaseException enum names/values to match WebCore.
      
      * public/WebIDBDatabaseException.h:
      * src/AssertMatchingEnums.cpp:
      * src/IDBFactoryBackendProxy.cpp:
      (WebKit::IDBFactoryBackendProxy::allowIndexedDB):
      * tests/IDBRequestTest.cpp:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136417 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      e9e60209
  15. 28 Nov, 2012 1 commit
  16. 01 Nov, 2012 1 commit
    • alecflett@chromium.org's avatar
      IndexedDB: add methods to support id-based backend APIs · e33cc6bd
      alecflett@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=100425
      
      Reviewed by Tony Chang.
      
      Source/WebCore:
      
      First half of refactor involves adding a number of methods that
      are int64_t-based rather than String-based. As a part of this, the
      IDB*Metadata structs and the backend objectStore/index maps all
      use int64_t as keys, rather than String.
      
      In addition, there were a number of cleanups that came out of the
      refactor:
      
      - The list of object stores active in a transaction is now
        maintained by the frontend IDBTransaction rather than the backend
        IDBTransactionBackendImpl. This also had a simplifying rippling
        effect through other call signatures.
      
      - I was able to remove an apparently old FIXME from
        IDBTransactionBackendImpl::objectStore and replace it with an ASSERT.
      
      - IDBObjectStoreBackendImpl's IndexWriter class got a little
        simpler since the id is now easily available in the
        IDBIndexMetadata.
      
      - A number of methods got simpler in their int64_t versions,
        specifically dropping a number of ExceptionCodes.
      
      There is also some glue code
      (getIndexId/getIndexIds/getObjectStoreId) that will go away with
      the 2nd half of this: https://bugs.webkit.org/show_bug.cgi?id=100425
      
      No new tests, no new functionality as this is just a refactor.
      
      * Modules/indexeddb/IDBDatabase.cpp:
      (WebCore::IDBDatabase::objectStoreNames):
      (WebCore::IDBDatabase::createObjectStore):
      (WebCore::IDBDatabase::deleteObjectStore):
      (WebCore::IDBDatabase::transaction):
      * Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
      (WebCore::IDBDatabaseBackendImpl::metadata):
      (WebCore::IDBDatabaseBackendImpl::createObjectStore):
      (WebCore::IDBDatabaseBackendImpl::objectStore):
      (WebCore::IDBDatabaseBackendImpl::getObjectStoreId):
      (WebCore):
      (WebCore::IDBDatabaseBackendImpl::deleteObjectStore):
      (WebCore::IDBDatabaseBackendImpl::transaction):
      (WebCore::IDBDatabaseBackendImpl::loadObjectStores):
      (WebCore::IDBDatabaseBackendImpl::removeObjectStoreFromMap):
      (WebCore::IDBDatabaseBackendImpl::addObjectStoreToMap):
      * Modules/indexeddb/IDBDatabaseBackendImpl.h:
      (WebCore::IDBDatabaseBackendImpl::deleteObjectStore):
      (IDBDatabaseBackendImpl):
      * Modules/indexeddb/IDBDatabaseBackendInterface.h:
      (IDBDatabaseBackendInterface):
      * Modules/indexeddb/IDBIndex.h:
      (WebCore::IDBIndex::id):
      (WebCore::IDBIndex::openKeyCursor):
      * Modules/indexeddb/IDBIndexBackendInterface.h:
      * Modules/indexeddb/IDBMetadata.h:
      (WebCore::IDBIndexMetadata::IDBIndexMetadata):
      (IDBIndexMetadata):
      (IDBObjectStoreMetadata):
      (WebCore::IDBObjectStoreMetadata::containsIndex):
      (IDBDatabaseMetadata):
      (WebCore::IDBDatabaseMetadata::IDBDatabaseMetadata):
      (WebCore::IDBDatabaseMetadata::containsObjectStore):
      * Modules/indexeddb/IDBObjectStore.cpp:
      (WebCore::IDBObjectStore::indexNames):
      (WebCore::IDBObjectStore::put):
      (WebCore::IDBObjectStore::createIndex):
      (WebCore::IDBObjectStore::index):
      (WebCore::IDBObjectStore::deleteIndex):
      * Modules/indexeddb/IDBObjectStoreBackendImpl.cpp:
      (WebCore::IDBObjectStoreBackendImpl::put):
      (WebCore::IDBObjectStoreBackendImpl::putWithIndexKeys):
      (WebCore):
      (WebCore::makeIndexWriters):
      (WebCore::IDBObjectStoreBackendImpl::setIndexKeys):
      (WebCore::IDBObjectStoreBackendImpl::setIndexesReady):
      (WebCore::IDBObjectStoreBackendImpl::setIndexesReadyInternal):
      (WebCore::IDBObjectStoreBackendImpl::putInternal):
      (WebCore::IDBObjectStoreBackendImpl::deleteInternal):
      (WebCore::IDBObjectStoreBackendImpl::createIndex):
      (WebCore::IDBObjectStoreBackendImpl::index):
      (WebCore::IDBObjectStoreBackendImpl::getIndexId):
      (WebCore::IDBObjectStoreBackendImpl::getIndexIds):
      (WebCore::IDBObjectStoreBackendImpl::deleteIndex):
      (WebCore::IDBObjectStoreBackendImpl::loadIndexes):
      (WebCore::IDBObjectStoreBackendImpl::removeIndexFromMap):
      (WebCore::IDBObjectStoreBackendImpl::addIndexToMap):
      * Modules/indexeddb/IDBObjectStoreBackendImpl.h:
      (IDBObjectStoreBackendImpl):
      * Modules/indexeddb/IDBObjectStoreBackendInterface.h:
      * Modules/indexeddb/IDBOpenDBRequest.cpp:
      (WebCore::IDBOpenDBRequest::onUpgradeNeeded):
      * Modules/indexeddb/IDBRequest.cpp:
      (WebCore::IDBRequest::onSuccess):
      (WebCore::IDBRequest::uncaughtExceptionInEventHandler):
      * Modules/indexeddb/IDBTransaction.cpp:
      (WebCore::IDBTransaction::create):
      (WebCore::IDBTransaction::IDBTransaction):
      (WebCore::IDBTransaction::objectStore):
      * Modules/indexeddb/IDBTransaction.h:
      (IDBTransaction):
      * Modules/indexeddb/IDBTransactionBackendImpl.cpp:
      (WebCore::IDBTransactionBackendImpl::create):
      (WebCore::IDBTransactionBackendImpl::IDBTransactionBackendImpl):
      (WebCore::IDBTransactionBackendImpl::objectStore):
      (WebCore):
      (WebCore::IDBTransactionBackendImpl::scheduleTask):
      * Modules/indexeddb/IDBTransactionBackendImpl.h:
      (IDBTransactionBackendImpl):
      * Modules/indexeddb/IDBTransactionBackendInterface.h:
      
      Source/WebKit/chromium:
      
      Chromium Proxy and WebIDB* support for new int64_t-based methods.
      
      * public/WebIDBDatabase.h:
      (WebKit::WebIDBDatabase::deleteObjectStore):
      (WebKit::WebIDBDatabase::transaction):
      * public/WebIDBObjectStore.h:
      (WebKit::WebIDBObjectStore::put):
      (WebKit::WebIDBObjectStore::setIndexKeys):
      (WebKit::WebIDBObjectStore::setIndexesReady):
      (WebKit::WebIDBObjectStore::index):
      (WebKit::WebIDBObjectStore::deleteIndex):
      * public/WebIDBTransaction.h:
      (WebKit::WebIDBTransaction::objectStore):
      * src/IDBDatabaseBackendProxy.cpp:
      (WebKit::IDBDatabaseBackendProxy::deleteObjectStore):
      (WebKit):
      (WebKit::IDBDatabaseBackendProxy::transaction):
      * src/IDBDatabaseBackendProxy.h:
      (IDBDatabaseBackendProxy):
      * src/IDBObjectStoreBackendProxy.cpp:
      (WebKit::IDBObjectStoreBackendProxy::put):
      (WebKit):
      (WebKit::IDBObjectStoreBackendProxy::setIndexKeys):
      (WebKit::IDBObjectStoreBackendProxy::setIndexesReady):
      (WebKit::IDBObjectStoreBackendProxy::index):
      (WebKit::IDBObjectStoreBackendProxy::deleteIndex):
      * src/IDBObjectStoreBackendProxy.h:
      (IDBObjectStoreBackendProxy):
      * src/IDBTransactionBackendProxy.cpp:
      (WebKit::IDBTransactionBackendProxy::objectStore):
      * src/IDBTransactionBackendProxy.h:
      (IDBTransactionBackendProxy):
      * src/WebIDBMetadata.cpp:
      (WebKit::WebIDBMetadata::WebIDBMetadata):
      (WebKit::WebIDBMetadata::operator IDBDatabaseMetadata):
      * src/WebIDBTransactionImpl.cpp:
      (WebKit::WebIDBTransactionImpl::objectStore):
      (WebKit):
      * src/WebIDBTransactionImpl.h:
      * tests/IDBDatabaseBackendTest.cpp:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133195 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      e33cc6bd
  17. 31 Oct, 2012 2 commits
    • senorblanco@chromium.org's avatar
      Unreviewed, rolling out r133107. · cde58494
      senorblanco@chromium.org authored
      http://trac.webkit.org/changeset/133107
      https://bugs.webkit.org/show_bug.cgi?id=100425
      
      Source/WebCore:
      
      Broke compile on Chromium Win.
      
      * Modules/indexeddb/IDBCallbacks.h:
      (IDBCallbacks):
      * Modules/indexeddb/IDBDatabase.cpp:
      (WebCore::IDBDatabase::objectStoreNames):
      (WebCore::IDBDatabase::createObjectStore):
      (WebCore::IDBDatabase::deleteObjectStore):
      (WebCore::IDBDatabase::transaction):
      * Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
      (WebCore::IDBDatabaseBackendImpl::metadata):
      (WebCore::IDBDatabaseBackendImpl::createObjectStore):
      (WebCore::IDBDatabaseBackendImpl::objectStore):
      (WebCore::IDBDatabaseBackendImpl::deleteObjectStore):
      (WebCore::IDBDatabaseBackendImpl::transaction):
      (WebCore::IDBDatabaseBackendImpl::loadObjectStores):
      (WebCore::IDBDatabaseBackendImpl::removeObjectStoreFromMap):
      (WebCore::IDBDatabaseBackendImpl::addObjectStoreToMap):
      * Modules/indexeddb/IDBDatabaseBackendImpl.h:
      (IDBDatabaseBackendImpl):
      * Modules/indexeddb/IDBDatabaseBackendInterface.h:
      (IDBDatabaseBackendInterface):
      * Modules/indexeddb/IDBFactory.cpp:
      * Modules/indexeddb/IDBFactory.h:
      * Modules/indexeddb/IDBIndex.h:
      (WebCore::IDBIndex::openKeyCursor):
      * Modules/indexeddb/IDBIndexBackendInterface.h:
      * Modules/indexeddb/IDBKeyPath.cpp:
      * Modules/indexeddb/IDBMetadata.h:
      (WebCore):
      (IDBDatabaseMetadata):
      (WebCore::IDBDatabaseMetadata::IDBDatabaseMetadata):
      (IDBObjectStoreMetadata):
      (WebCore::IDBIndexMetadata::IDBIndexMetadata):
      (IDBIndexMetadata):
      * Modules/indexeddb/IDBObjectStore.cpp:
      (WebCore::IDBObjectStore::indexNames):
      (WebCore::IDBObjectStore::put):
      (WebCore::IDBObjectStore::createIndex):
      (WebCore::IDBObjectStore::index):
      (WebCore::IDBObjectStore::deleteIndex):
      * Modules/indexeddb/IDBObjectStoreBackendImpl.cpp:
      (WebCore::IDBObjectStoreBackendImpl::putWithIndexKeys):
      (WebCore):
      (WebCore::makeIndexWriters):
      (WebCore::IDBObjectStoreBackendImpl::setIndexKeys):
      (WebCore::IDBObjectStoreBackendImpl::setIndexesReady):
      (WebCore::IDBObjectStoreBackendImpl::setIndexesReadyInternal):
      (WebCore::IDBObjectStoreBackendImpl::putInternal):
      (WebCore::IDBObjectStoreBackendImpl::deleteInternal):
      (WebCore::IDBObjectStoreBackendImpl::createIndex):
      (WebCore::IDBObjectStoreBackendImpl::index):
      (WebCore::IDBObjectStoreBackendImpl::deleteIndex):
      (WebCore::IDBObjectStoreBackendImpl::loadIndexes):
      (WebCore::IDBObjectStoreBackendImpl::removeIndexFromMap):
      (WebCore::IDBObjectStoreBackendImpl::addIndexToMap):
      * Modules/indexeddb/IDBObjectStoreBackendImpl.h:
      (IDBObjectStoreBackendImpl):
      * Modules/indexeddb/IDBObjectStoreBackendInterface.h:
      * Modules/indexeddb/IDBOpenDBRequest.cpp:
      (WebCore::IDBOpenDBRequest::onUpgradeNeeded):
      * Modules/indexeddb/IDBRequest.cpp:
      (WebCore::IDBRequest::onSuccess):
      (WebCore::IDBRequest::uncaughtExceptionInEventHandler):
      * Modules/indexeddb/IDBTransaction.cpp:
      (WebCore::IDBTransaction::create):
      (WebCore::IDBTransaction::IDBTransaction):
      (WebCore::IDBTransaction::objectStore):
      * Modules/indexeddb/IDBTransaction.h:
      (IDBTransaction):
      * Modules/indexeddb/IDBTransactionBackendImpl.cpp:
      (WebCore::IDBTransactionBackendImpl::create):
      (WebCore::IDBTransactionBackendImpl::IDBTransactionBackendImpl):
      (WebCore::IDBTransactionBackendImpl::objectStore):
      (WebCore::IDBTransactionBackendImpl::scheduleTask):
      * Modules/indexeddb/IDBTransactionBackendImpl.h:
      (IDBTransactionBackendImpl):
      * Modules/indexeddb/IDBTransactionBackendInterface.h:
      * Modules/indexeddb/IDBTransactionCoordinator.h:
      
      Source/WebKit/chromium:
      
      Broke compile on Chromium Win
      
      * public/WebIDBDatabase.h:
      (WebKit::WebIDBDatabase::transaction):
      * public/WebIDBObjectStore.h:
      (WebKit::WebIDBObjectStore::index):
      * public/WebIDBTransaction.h:
      (WebKit::WebIDBTransaction::objectStore):
      * src/IDBDatabaseBackendProxy.cpp:
      * src/IDBDatabaseBackendProxy.h:
      (IDBDatabaseBackendProxy):
      * src/IDBObjectStoreBackendProxy.cpp:
      (WebKit::IDBObjectStoreBackendProxy::setIndexesReady):
      * src/IDBObjectStoreBackendProxy.h:
      (IDBObjectStoreBackendProxy):
      * src/IDBTransactionBackendProxy.cpp:
      * src/IDBTransactionBackendProxy.h:
      (IDBTransactionBackendProxy):
      * src/WebIDBCallbacksImpl.cpp:
      * src/WebIDBDatabaseImpl.cpp:
      * src/WebIDBDatabaseImpl.h:
      (WebIDBDatabaseImpl):
      * src/WebIDBMetadata.cpp:
      (WebKit::WebIDBMetadata::WebIDBMetadata):
      (WebKit::WebIDBMetadata::operator IDBDatabaseMetadata):
      * src/WebIDBObjectStoreImpl.cpp:
      * src/WebIDBObjectStoreImpl.h:
      (WebIDBObjectStoreImpl):
      * src/WebIDBTransactionImpl.cpp:
      * src/WebIDBTransactionImpl.h:
      * tests/IDBDatabaseBackendTest.cpp:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133112 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      cde58494
    • alecflett@chromium.org's avatar
      IndexedDB: add methods to support id-based backend APIs · 2d73ecdb
      alecflett@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=100425
      
      Reviewed by Tony Chang.
      
      Source/WebCore:
      
      First half of refactor involves adding a number of methods that
      are int64_t-based rather than String-based. As a part of this, the
      IDB*Metadata structs and the backend objectStore/index maps all
      use int64_t as keys, rather than String.
      
      In addition, there were a number of cleanups that came out of the
      refactor:
      
      - The list of object stores active in a transaction is now
        maintained by the frontend IDBTransaction rather than the backend
        IDBTransactionBackendImpl. This also had a simplifying rippling
        effect through other call signatures.
      
      - I was able to remove an apparently old FIXME from
        IDBTransactionBackendImpl::objectStore and replace it with an ASSERT.
      
      - IDBObjectStoreBackendImpl's IndexWriter class got a little
        simpler since the id is now easily available in the
        IDBIndexMetadata.
      
      - A number of methods got simpler in their int64_t versions,
        specifically dropping a number of ExceptionCodes.
      
      There is also some glue code
      (getIndexId/getIndexIds/getObjectStoreId) that will go away with
      the 2nd half of this: https://bugs.webkit.org/show_bug.cgi?id=100425
      
      No new tests, no new functionality as this is just a refactor.
      
      * Modules/indexeddb/IDBDatabase.cpp:
      (WebCore::IDBDatabase::objectStoreNames):
      (WebCore::IDBDatabase::createObjectStore):
      (WebCore::IDBDatabase::deleteObjectStore):
      (WebCore::IDBDatabase::transaction):
      * Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
      (WebCore::IDBDatabaseBackendImpl::metadata):
      (WebCore::IDBDatabaseBackendImpl::createObjectStore):
      (WebCore::IDBDatabaseBackendImpl::objectStore):
      (WebCore::IDBDatabaseBackendImpl::getObjectStoreId):
      (WebCore):
      (WebCore::IDBDatabaseBackendImpl::deleteObjectStore):
      (WebCore::IDBDatabaseBackendImpl::transaction):
      (WebCore::IDBDatabaseBackendImpl::loadObjectStores):
      (WebCore::IDBDatabaseBackendImpl::removeObjectStoreFromMap):
      (WebCore::IDBDatabaseBackendImpl::addObjectStoreToMap):
      * Modules/indexeddb/IDBDatabaseBackendImpl.h:
      (WebCore::IDBDatabaseBackendImpl::deleteObjectStore):
      (IDBDatabaseBackendImpl):
      * Modules/indexeddb/IDBDatabaseBackendInterface.h:
      (IDBDatabaseBackendInterface):
      * Modules/indexeddb/IDBIndex.h:
      (WebCore::IDBIndex::id):
      (WebCore::IDBIndex::openKeyCursor):
      * Modules/indexeddb/IDBIndexBackendInterface.h:
      * Modules/indexeddb/IDBMetadata.h:
      (WebCore::IDBIndexMetadata::IDBIndexMetadata):
      (IDBIndexMetadata):
      (IDBObjectStoreMetadata):
      (WebCore::IDBObjectStoreMetadata::containsIndex):
      (IDBDatabaseMetadata):
      (WebCore::IDBDatabaseMetadata::IDBDatabaseMetadata):
      (WebCore::IDBDatabaseMetadata::containsObjectStore):
      * Modules/indexeddb/IDBObjectStore.cpp:
      (WebCore::IDBObjectStore::indexNames):
      (WebCore::IDBObjectStore::put):
      (WebCore::IDBObjectStore::createIndex):
      (WebCore::IDBObjectStore::index):
      (WebCore::IDBObjectStore::deleteIndex):
      * Modules/indexeddb/IDBObjectStoreBackendImpl.cpp:
      (WebCore::IDBObjectStoreBackendImpl::put):
      (WebCore::IDBObjectStoreBackendImpl::putWithIndexKeys):
      (WebCore):
      (WebCore::makeIndexWriters):
      (WebCore::IDBObjectStoreBackendImpl::setIndexKeys):
      (WebCore::IDBObjectStoreBackendImpl::setIndexesReady):
      (WebCore::IDBObjectStoreBackendImpl::setIndexesReadyInternal):
      (WebCore::IDBObjectStoreBackendImpl::putInternal):
      (WebCore::IDBObjectStoreBackendImpl::deleteInternal):
      (WebCore::IDBObjectStoreBackendImpl::createIndex):
      (WebCore::IDBObjectStoreBackendImpl::index):
      (WebCore::IDBObjectStoreBackendImpl::getIndexId):
      (WebCore::IDBObjectStoreBackendImpl::getIndexIds):
      (WebCore::IDBObjectStoreBackendImpl::deleteIndex):
      (WebCore::IDBObjectStoreBackendImpl::loadIndexes):
      (WebCore::IDBObjectStoreBackendImpl::removeIndexFromMap):
      (WebCore::IDBObjectStoreBackendImpl::addIndexToMap):
      * Modules/indexeddb/IDBObjectStoreBackendImpl.h:
      (IDBObjectStoreBackendImpl):
      * Modules/indexeddb/IDBObjectStoreBackendInterface.h:
      * Modules/indexeddb/IDBOpenDBRequest.cpp:
      (WebCore::IDBOpenDBRequest::onUpgradeNeeded):
      * Modules/indexeddb/IDBRequest.cpp:
      (WebCore::IDBRequest::onSuccess):
      (WebCore::IDBRequest::uncaughtExceptionInEventHandler):
      * Modules/indexeddb/IDBTransaction.cpp:
      (WebCore::IDBTransaction::create):
      (WebCore::IDBTransaction::IDBTransaction):
      (WebCore::IDBTransaction::objectStore):
      * Modules/indexeddb/IDBTransaction.h:
      (IDBTransaction):
      * Modules/indexeddb/IDBTransactionBackendImpl.cpp:
      (WebCore::IDBTransactionBackendImpl::create):
      (WebCore::IDBTransactionBackendImpl::IDBTransactionBackendImpl):
      (WebCore::IDBTransactionBackendImpl::objectStore):
      (WebCore):
      (WebCore::IDBTransactionBackendImpl::scheduleTask):
      * Modules/indexeddb/IDBTransactionBackendImpl.h:
      (IDBTransactionBackendImpl):
      * Modules/indexeddb/IDBTransactionBackendInterface.h:
      
      Source/WebKit/chromium:
      
      Chromium Proxy and WebIDB* support for new int64_t-based methods.
      
      * public/WebIDBDatabase.h:
      (WebKit::WebIDBDatabase::deleteObjectStore):
      (WebKit::WebIDBDatabase::transaction):
      * public/WebIDBObjectStore.h:
      (WebKit::WebIDBObjectStore::put):
      (WebKit::WebIDBObjectStore::setIndexKeys):
      (WebKit::WebIDBObjectStore::setIndexesReady):
      (WebKit::WebIDBObjectStore::index):
      (WebKit::WebIDBObjectStore::deleteIndex):
      * public/WebIDBTransaction.h:
      (WebKit::WebIDBTransaction::objectStore):
      * src/IDBDatabaseBackendProxy.cpp:
      (WebKit::IDBDatabaseBackendProxy::deleteObjectStore):
      (WebKit):
      (WebKit::IDBDatabaseBackendProxy::transaction):
      * src/IDBDatabaseBackendProxy.h:
      (IDBDatabaseBackendProxy):
      * src/IDBObjectStoreBackendProxy.cpp:
      (WebKit::IDBObjectStoreBackendProxy::put):
      (WebKit):
      (WebKit::IDBObjectStoreBackendProxy::setIndexKeys):
      (WebKit::IDBObjectStoreBackendProxy::setIndexesReady):
      (WebKit::IDBObjectStoreBackendProxy::index):
      (WebKit::IDBObjectStoreBackendProxy::deleteIndex):
      * src/IDBObjectStoreBackendProxy.h:
      (IDBObjectStoreBackendProxy):
      * src/IDBTransactionBackendProxy.cpp:
      (WebKit::IDBTransactionBackendProxy::objectStore):
      * src/IDBTransactionBackendProxy.h:
      (IDBTransactionBackendProxy):
      * src/WebIDBMetadata.cpp:
      (WebKit::WebIDBMetadata::WebIDBMetadata):
      (WebKit::WebIDBMetadata::operator IDBDatabaseMetadata):
      * src/WebIDBTransactionImpl.cpp:
      (WebKit::WebIDBTransactionImpl::objectStore):
      (WebKit):
      * src/WebIDBTransactionImpl.h:
      * tests/IDBDatabaseBackendTest.cpp:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133107 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      2d73ecdb
  18. 17 Oct, 2012 1 commit
    • jsbell@chromium.org's avatar
      IndexedDB: Closing connection in upgradeneeded should result in error event · fdeaab3e
      jsbell@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=99486
      
      Reviewed by Tony Chang.
      
      Source/WebCore:
      
      The IDB spec requires that "...if connection is closed, return a DOMError of type AbortError".
      This was being handled during the "enqueue" phase, which was too early either for synchronously
      executing scripts or asynchronous messaging in multiprocess ports (crbug.com/150691). Move the
      logic to the "dispatch" phase.
      
      Test: storage/indexeddb/intversion-close-in-oncomplete.html
      
      * Modules/indexeddb/IDBOpenDBRequest.cpp:
      (WebCore::IDBOpenDBRequest::onSuccess): Move success to error morphing from here...
      (WebCore::IDBOpenDBRequest::dispatchEvent): To here.
      * Modules/indexeddb/IDBOpenDBRequest.h:
      (IDBOpenDBRequest):
      
      LayoutTests:
      
      Updated test expectation - error, not success.
      
      * storage/indexeddb/intversion-close-in-oncomplete-expected.txt:
      * storage/indexeddb/resources/intversion-close-in-oncomplete.js:
      (deleteSuccess):
      (upgradeNeeded.transaction.oncomplete):
      (upgradeNeeded):
      (openError):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131668 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      fdeaab3e
  19. 02 Oct, 2012 1 commit
    • dgrogan@chromium.org's avatar
      IndexedDB: Don't wedge if page reloads with pending upgradeneeded · 04aa1987
      dgrogan@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=98091
      
      Reviewed by Tony Chang.
      
      Source/WebCore:
      
      Test: storage/indexeddb/dont-wedge.html
      
      * Modules/indexeddb/IDBOpenDBRequest.cpp:
      (WebCore::IDBOpenDBRequest::onUpgradeNeeded):
      This got the same treatment as IDBRequest::onSuccess(Transaction).
      Explicitly tell the backend objects that they are going away so that
      m_runningVersionChangeTransaction is cleared and connectionCount()
      decreases.
      
      LayoutTests:
      
      dont-wedge.js was derived from
      transaction-coordination-across-databases.js.
      
      This would have passed in DRT without this patch, but not in
      content_shell.
      
      * storage/indexeddb/dont-wedge-expected.txt: Added.
      * storage/indexeddb/dont-wedge.html: Added.
      * storage/indexeddb/resources/dont-wedge.js: Added.
      (test):
      (deleteDatabase1.request.onblocked):
      (deleteDatabase1):
      (deleteDatabase2):
      (isAfterReload):
      (reload):
      (openDatabase1.request.onupgradeneeded):
      (openDatabase1.request.onsuccess):
      (openDatabase1):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130199 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      04aa1987
  20. 19 Sep, 2012 1 commit
    • dgrogan@chromium.org's avatar
      IndexedDB: fire upgradeneeded even without an explicit integer version · 5f450791
      dgrogan@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=96444
      
      Reviewed by Tony Chang.
      
      Source/WebCore:
      
      Also of note:
      - New databases now get a default version of 1 instead of
      the empty string when they are opened.
      - We now allow databases with an integer version to revert to a string
      version by calling setVersion.
      
      Implementation detail: we store both an integer version and string
      version for a particular database. If both are set we give preference
      to the integer version and assume the db is on the integer track.
      
      Test: storage/indexeddb/intversion-two-opens-no-versions.html
      
      * Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
      (WebCore):
      (WebCore::IDBDatabaseBackendImpl::IDBDatabaseBackendImpl):
      (WebCore::IDBDatabaseBackendImpl::setVersion):
      (WebCore::IDBDatabaseBackendImpl::setVersionInternal):
      Now that this can be called even after an int version is set we have
      to make it revoke the int version.
      
      (WebCore::IDBDatabaseBackendImpl::openConnection):
      Nested ifs were getting deep, so refactor to return early instead.
      
      (WebCore::IDBDatabaseBackendImpl::deleteDatabase):
      (WebCore::IDBDatabaseBackendImpl::resetVersion):
      Now that an int version could have been set before setVersion was
      called we have to reset the int version on abort.
      
      * Modules/indexeddb/IDBDatabaseBackendImpl.h:
      (IDBDatabaseBackendImpl):
      * Modules/indexeddb/IDBLevelDBBackingStore.cpp:
      (WebCore::IDBLevelDBBackingStore::updateIDBDatabaseIntVersion):
      * Modules/indexeddb/IDBOpenDBRequest.cpp:
      0 is now a valid integer version to store to leveldb if an idb
      database is reverting to a string version.
      
      (WebCore::IDBOpenDBRequest::onUpgradeNeeded):
      If the open request did not specify an integer version but
      upgradeneeded is called, it means the database was given the default
      version of 1.
      
      LayoutTests:
      
      Mostly updating expectations about getting an upgradeneeded on a new
      database and the default version being 1 instead of "".
      
      * http/tests/inspector/indexeddb/database-structure-expected.txt:
      * storage/indexeddb/cursor-overloads-expected.txt:
      * storage/indexeddb/cursor-overloads.html:
      * storage/indexeddb/dont-commit-on-blocked-expected.txt:
      * storage/indexeddb/dont-commit-on-blocked.html:
      * storage/indexeddb/factory-deletedatabase-interactions-expected.txt:
      * storage/indexeddb/intversion-and-setversion-expected.txt:
      Remove test that setVersion fires an error if an int version is set.
      Change it to testing that an int version can replace a string version
      that replaced an int version.
      
      * storage/indexeddb/intversion-bad-parameters-expected.txt:
      * storage/indexeddb/intversion-invalid-setversion-has-no-side-effects-expected.txt: Removed.
      setVersion is no longer invalid so this test can be deleted.
      
      * storage/indexeddb/intversion-omit-parameter-expected.txt:
      We now fully pass this test.
      
      * storage/indexeddb/intversion-two-opens-no-versions-expected.txt: Added.
      * storage/indexeddb/intversion-two-opens-no-versions.html: Renamed from LayoutTests/storage/indexeddb/intversion-invalid-setversion-has-no-side-effects.html.
      * storage/indexeddb/list-ordering-expected.txt:
      * storage/indexeddb/noblobs-expected.txt:
      * storage/indexeddb/noblobs.html:
      * storage/indexeddb/open-during-transaction-expected.txt:
      This test had a bug in it AND its behavior is changed. It was trying
      to open one database twice and another once but was actually opening
      three different databases. The behavior change is that now the
      transaction finishes while the last call to open is firing
      upgradeneeded.
      
      * storage/indexeddb/pending-activity-expected.txt:
      * storage/indexeddb/pending-activity-workers-expected.txt:
      * storage/indexeddb/resources/intversion-and-setversion.js:
      (deleteSuccess):
      (initialUpgradeNeeded):
      (openSuccess):
      (firstUpgradeNeeded):
      (transactionCompleted):
      (firstOpenWithVersion):
      (secondSetVersionCallback):
      (setIntVersion2):
      (versionChangeGoingFromStringToInt):
      (version2ConnectionBlocked):
      (version2ConnectionSuccess):
      (errorWhenTryingLowVersion):
      * storage/indexeddb/resources/intversion-invalid-setversion-has-no-side-effects.js: Removed.
      * storage/indexeddb/resources/intversion-two-opens-no-versions.js: Added.
      (test):
      (deleteSuccess):
      (connection1UpgradeNeeded):
      (connection1OpenSuccess):
      (connection2UpgradeNeeded):
      (connection2OpenSuccess):
      * storage/indexeddb/resources/list-ordering.js:
      * storage/indexeddb/resources/open-during-transaction.js:
      (startTransaction.trans.oncomplete):
      (startTransaction):
      (tryOpens.openreq3.onsuccess):
      (tryOpens):
      * storage/indexeddb/resources/pending-activity.js:
      * storage/indexeddb/structured-clone-expected.txt:
      * storage/indexeddb/structured-clone.html:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@129037 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      5f450791
  21. 14 Sep, 2012 1 commit
    • jsbell@chromium.org's avatar
      IndexedDB: Calling close() during upgradeneeded handler should fire error at open request · bd1cfeab
      jsbell@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=96807
      
      Reviewed by Tony Chang.
      
      Source/WebCore:
      
      Per spec, if the database connection is closed before the success event fires, the request
      should have an error event of type AbortError fired at it.
      
      Test: storage/indexeddb/intversion-close-in-upgradeneeded.html
      
      * Modules/indexeddb/IDBDatabase.h:
      (WebCore::IDBDatabase::isClosePending): Expose this state so an in-flight success can be morphed.
      * Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
      (WebCore::IDBDatabaseBackendImpl::close): Fire the appropriate error at connections that are mid-opening.
      * Modules/indexeddb/IDBOpenDBRequest.cpp:
      (WebCore::IDBOpenDBRequest::onSuccess): If the connection was closed before the success is enqueued -
      which can happen in multi-process ports with asynchronous messaging - convert the success to an error.
      
      LayoutTests:
      
      Update the test to match the spec behavior.
      
      * storage/indexeddb/intversion-close-in-upgradeneeded-expected.txt:
      * storage/indexeddb/resources/intversion-close-in-upgradeneeded.js:
      (deleteSuccess):
      (upgradeNeeded.transaction.oncomplete):
      (upgradeNeeded):
      (openError):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128674 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      bd1cfeab
  22. 13 Sep, 2012 3 commits
    • jsbell@chromium.org's avatar
      IndexedDB: Consolidate two-phase connection to avoid race conditions · cfcf5953
      jsbell@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=90411
      
      Reviewed by Tony Chang.
      
      Source/WebCore:
      
      Previously, IDB connections were opened by having the front-end (1) call through to
      a back-end open() method, eventually receive a success message with a back-end object
      handle, and (2) call into the back-end object to register front-end callbacks. This left
      the back-end's notion of an open connection in a limbo state between these two calls.
      In multi-process ports, a crash of the front-end process could leave the back-end wedged
      waiting for this second call (e.g. can't delete until all connections are closed).
      
      Simplify this by having the front-end pass through the callbacks into the back-end
      during the initial open() call, which eliminates the limbo state.
      
      No new tests - no functional changes. Chromium port's webkit_unit_tests updated.
      
      * Modules/indexeddb/IDBDatabase.cpp:
      (WebCore::IDBDatabase::create):
      (WebCore::IDBDatabase::IDBDatabase): Db-callbacks is available at creation time.
      (WebCore::IDBDatabase::~IDBDatabase):
      * Modules/indexeddb/IDBDatabase.h:
      (IDBDatabase):
      * Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
      (WebCore::IDBDatabaseBackendImpl::PendingOpenCall::create): Need to track db-callbacks as well.
      (WebCore::IDBDatabaseBackendImpl::PendingOpenCall::databaseCallbacks):
      (WebCore::IDBDatabaseBackendImpl::PendingOpenCall::PendingOpenCall):
      (IDBDatabaseBackendImpl::PendingOpenCall):
      (WebCore::IDBDatabaseBackendImpl::PendingOpenWithVersionCall::create): Ditto.
      (WebCore::IDBDatabaseBackendImpl::PendingOpenWithVersionCall::databaseCallbacks):
      (WebCore::IDBDatabaseBackendImpl::PendingOpenWithVersionCall::PendingOpenWithVersionCall):
      (IDBDatabaseBackendImpl::PendingOpenWithVersionCall):
      (WebCore::IDBDatabaseBackendImpl::IDBDatabaseBackendImpl):
      (WebCore::IDBDatabaseBackendImpl::setVersion):
      (WebCore::IDBDatabaseBackendImpl::connectionCount): Don't need to count limbo connections any more.
      (WebCore::IDBDatabaseBackendImpl::processPendingCalls): Pass through db-callbacks.
      (WebCore::IDBDatabaseBackendImpl::openConnection): No more limbo connections (yay!).
      (WebCore::IDBDatabaseBackendImpl::runIntVersionChangeTransaction): Pass through db-callbacks.
      (WebCore::IDBDatabaseBackendImpl::openConnectionWithVersion): Ditto.
      (WebCore::IDBDatabaseBackendImpl::deleteDatabase): Style.
      (WebCore::IDBDatabaseBackendImpl::close): Resolve FIXME about connectionCount.
      * Modules/indexeddb/IDBDatabaseBackendImpl.h:
      (IDBDatabaseBackendImpl):
      * Modules/indexeddb/IDBDatabaseBackendInterface.h:
      (IDBDatabaseBackendInterface):
      * Modules/indexeddb/IDBDatabaseCallbacksImpl.cpp:
      (WebCore::IDBDatabaseCallbacksImpl::create):
      (WebCore::IDBDatabaseCallbacksImpl::IDBDatabaseCallbacksImpl):
      (WebCore::IDBDatabaseCallbacksImpl::connect):
      * Modules/indexeddb/IDBDatabaseCallbacksImpl.h:
      (IDBDatabaseCallbacksImpl):
      * Modules/indexeddb/IDBFactory.cpp:
      (WebCore::IDBFactory::open): Mint the db-callbacks here...
      * Modules/indexeddb/IDBFactoryBackendImpl.cpp:
      (WebCore::IDBFactoryBackendImpl::open): ...passed through to here...
      * Modules/indexeddb/IDBFactoryBackendImpl.h:
      (IDBFactoryBackendImpl):
      * Modules/indexeddb/IDBFactoryBackendInterface.h:
      (IDBFactoryBackendInterface):
      * Modules/indexeddb/IDBOpenDBRequest.cpp:
      (WebCore::IDBOpenDBRequest::create): ...all the way to here...
      (WebCore::IDBOpenDBRequest::IDBOpenDBRequest):
      (WebCore::IDBOpenDBRequest::onUpgradeNeeded): ...and finally hooked up here.
      (WebCore::IDBOpenDBRequest::onSuccess): (or here, if no upgrade needed).
      * Modules/indexeddb/IDBOpenDBRequest.h:
      (WebCore):
      (IDBOpenDBRequest):
      * Modules/indexeddb/IDBTransaction.cpp:
      (WebCore::IDBTransaction::onAbort): Tweak event/notification ordering; the
      notifying the database that the transaction is finished may unblock closing,
      which fires more events, and the delivery matters. Previously the close would
      be blocked by the transaction which gave the desired order.
      (WebCore::IDBTransaction::onComplete): Ditto.
      * inspector/InspectorIndexedDBAgent.cpp: New hookup logic.
      (WebCore):
      
      Source/WebKit/chromium:
      
      API plumbing for simplified single-phase connection opening, and tests updated
      to exercise the new APIs.
      
      * public/WebIDBDatabase.h:
      (WebIDBDatabase): Just a FIXME to remove the old second-phase hookup API.
      * public/WebIDBFactory.h:
      (WebKit):
      (WebIDBFactory):
      (WebKit::WebIDBFactory::open): New overload that takes db-callbacks.
      * src/IDBCallbacksProxy.cpp: The db-callbacks plumbing is needed earlier.
      (WebKit::IDBCallbacksProxy::onSuccess):
      (WebKit::IDBCallbacksProxy::onUpgradeNeeded):
      (WebKit):
      (WebKit::IDBCallbacksProxy::setDatabaseCallbacks): Needs to hold on to
      the db-callbacks and hook it up when the onSuccess callback comes through.
      * src/IDBCallbacksProxy.h:
      (WebKit):
      (IDBCallbacksProxy):
      * src/IDBDatabaseBackendProxy.cpp:
      * src/IDBDatabaseBackendProxy.h:
      (IDBDatabaseBackendProxy):
      * src/IDBFactoryBackendProxy.cpp:
      (WebKit::IDBFactoryBackendProxy::open):
      * src/IDBFactoryBackendProxy.h:
      (IDBFactoryBackendProxy):
      * src/WebIDBDatabaseImpl.cpp:
      (WebKit::WebIDBDatabaseImpl::WebIDBDatabaseImpl):
      (WebKit::WebIDBDatabaseImpl::close):
      * src/WebIDBDatabaseImpl.h:
      (WebIDBDatabaseImpl):
      * src/WebIDBFactoryImpl.cpp:
      (WebKit::WebIDBFactoryImpl::open):
      * src/WebIDBFactoryImpl.h:
      (WebIDBFactoryImpl):
      * tests/IDBAbortOnCorruptTest.cpp:
      (FakeIDBDatabaseCallbacks):
      (WebCore::FakeIDBDatabaseCallbacks::create):
      (WebCore::FakeIDBDatabaseCallbacks::~FakeIDBDatabaseCallbacks):
      (WebCore::FakeIDBDatabaseCallbacks::FakeIDBDatabaseCallbacks):
      (WebCore):
      (WebCore::TEST): Updated connection sequence.
      * tests/IDBDatabaseBackendTest.cpp: Ditto.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128533 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      cfcf5953
    • commit-queue@webkit.org's avatar
      Unreviewed, rolling out r128489. · 2fe19b24
      commit-queue@webkit.org authored
      http://trac.webkit.org/changeset/128489
      https://bugs.webkit.org/show_bug.cgi?id=96686
      
      Does not compile on windows (Requested by jamesr on #webkit).
      
      Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2012-09-13
      
      Source/WebCore:
      
      * Modules/indexeddb/IDBDatabase.cpp:
      (WebCore::IDBDatabase::create):
      (WebCore::IDBDatabase::IDBDatabase):
      (WebCore::IDBDatabase::~IDBDatabase):
      (WebCore::IDBDatabase::registerFrontendCallbacks):
      (WebCore):
      * Modules/indexeddb/IDBDatabase.h:
      (IDBDatabase):
      * Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
      (WebCore::IDBDatabaseBackendImpl::PendingOpenCall::create):
      (WebCore::IDBDatabaseBackendImpl::PendingOpenCall::PendingOpenCall):
      (IDBDatabaseBackendImpl::PendingOpenCall):
      (WebCore::IDBDatabaseBackendImpl::PendingOpenWithVersionCall::create):
      (WebCore::IDBDatabaseBackendImpl::PendingOpenWithVersionCall::PendingOpenWithVersionCall):
      (WebCore::IDBDatabaseBackendImpl::IDBDatabaseBackendImpl):
      (WebCore::IDBDatabaseBackendImpl::setVersion):
      (WebCore::IDBDatabaseBackendImpl::connectionCount):
      (WebCore::IDBDatabaseBackendImpl::processPendingCalls):
      (WebCore::IDBDatabaseBackendImpl::registerFrontendCallbacks):
      (WebCore):
      (WebCore::IDBDatabaseBackendImpl::openConnection):
      (WebCore::IDBDatabaseBackendImpl::runIntVersionChangeTransaction):
      (WebCore::IDBDatabaseBackendImpl::openConnectionWithVersion):
      (WebCore::IDBDatabaseBackendImpl::deleteDatabase):
      (WebCore::IDBDatabaseBackendImpl::close):
      * Modules/indexeddb/IDBDatabaseBackendImpl.h:
      (IDBDatabaseBackendImpl):
      * Modules/indexeddb/IDBDatabaseBackendInterface.h:
      (IDBDatabaseBackendInterface):
      * Modules/indexeddb/IDBDatabaseCallbacksImpl.cpp:
      (WebCore::IDBDatabaseCallbacksImpl::create):
      (WebCore::IDBDatabaseCallbacksImpl::IDBDatabaseCallbacksImpl):
      (WebCore::IDBDatabaseCallbacksImpl::unregisterDatabase):
      * Modules/indexeddb/IDBDatabaseCallbacksImpl.h:
      (IDBDatabaseCallbacksImpl):
      * Modules/indexeddb/IDBFactory.cpp:
      (WebCore::IDBFactory::open):
      * Modules/indexeddb/IDBFactoryBackendImpl.cpp:
      (WebCore::IDBFactoryBackendImpl::open):
      * Modules/indexeddb/IDBFactoryBackendImpl.h:
      (IDBFactoryBackendImpl):
      * Modules/indexeddb/IDBFactoryBackendInterface.h:
      (IDBFactoryBackendInterface):
      * Modules/indexeddb/IDBOpenDBRequest.cpp:
      (WebCore::IDBOpenDBRequest::create):
      (WebCore::IDBOpenDBRequest::IDBOpenDBRequest):
      (WebCore::IDBOpenDBRequest::onUpgradeNeeded):
      (WebCore::IDBOpenDBRequest::onSuccess):
      * Modules/indexeddb/IDBOpenDBRequest.h:
      (IDBOpenDBRequest):
      * Modules/indexeddb/IDBTransaction.cpp:
      (WebCore::IDBTransaction::onAbort):
      (WebCore::IDBTransaction::onComplete):
      * inspector/InspectorIndexedDBAgent.cpp:
      (WebCore):
      
      Source/WebKit/chromium:
      
      * public/WebIDBDatabase.h:
      * public/WebIDBFactory.h:
      (WebIDBFactory):
      * src/IDBCallbacksProxy.cpp:
      (WebKit::IDBCallbacksProxy::onSuccess):
      (WebKit::IDBCallbacksProxy::onUpgradeNeeded):
      * src/IDBCallbacksProxy.h:
      (WebKit):
      (IDBCallbacksProxy):
      * src/IDBDatabaseBackendProxy.cpp:
      (WebKit::IDBDatabaseBackendProxy::registerFrontendCallbacks):
      (WebKit):
      * src/IDBDatabaseBackendProxy.h:
      (IDBDatabaseBackendProxy):
      * src/IDBFactoryBackendProxy.cpp:
      (WebKit::IDBFactoryBackendProxy::open):
      * src/IDBFactoryBackendProxy.h:
      (IDBFactoryBackendProxy):
      * src/WebIDBDatabaseImpl.cpp:
      (WebKit::WebIDBDatabaseImpl::WebIDBDatabaseImpl):
      (WebKit::WebIDBDatabaseImpl::close):
      (WebKit::WebIDBDatabaseImpl::open):
      (WebKit):
      * src/WebIDBDatabaseImpl.h:
      (WebIDBDatabaseImpl):
      * src/WebIDBFactoryImpl.cpp:
      (WebKit::WebIDBFactoryImpl::open):
      * src/WebIDBFactoryImpl.h:
      (WebIDBFactoryImpl):
      * tests/IDBAbortOnCorruptTest.cpp:
      (WebCore::TEST):
      * tests/IDBDatabaseBackendTest.cpp:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128496 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      2fe19b24
    • jsbell@chromium.org's avatar
      IndexedDB: Consolidate two-phase connection to avoid race conditions · 6bbf86d1
      jsbell@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=90411
      
      Reviewed by Tony Chang.
      
      Source/WebCore:
      
      Previously, IDB connections were opened by having the front-end (1) call through to
      a back-end open() method, eventually receive a success message with a back-end object
      handle, and (2) call into the back-end object to register front-end callbacks. This left
      the back-end's notion of an open connection in a limbo state between these two calls.
      In multi-process ports, a crash of the front-end process could leave the back-end wedged
      waiting for this second call (e.g. can't delete until all connections are closed).
      
      Simplify this by having the front-end pass through the callbacks into the back-end
      during the initial open() call, which eliminates the limbo state.
      
      No new tests - no functional changes. Chromium port's webkit_unit_tests updated.
      
      * Modules/indexeddb/IDBDatabase.cpp:
      (WebCore::IDBDatabase::create):
      (WebCore::IDBDatabase::IDBDatabase): Db-callbacks is available at creation time.
      (WebCore::IDBDatabase::~IDBDatabase):
      * Modules/indexeddb/IDBDatabase.h:
      (IDBDatabase):
      * Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
      (WebCore::IDBDatabaseBackendImpl::PendingOpenCall::create): Need to track db-callbacks as well.
      (WebCore::IDBDatabaseBackendImpl::PendingOpenCall::databaseCallbacks):
      (WebCore::IDBDatabaseBackendImpl::PendingOpenCall::PendingOpenCall):
      (IDBDatabaseBackendImpl::PendingOpenCall):
      (WebCore::IDBDatabaseBackendImpl::PendingOpenWithVersionCall::create): Ditto.
      (WebCore::IDBDatabaseBackendImpl::PendingOpenWithVersionCall::databaseCallbacks):
      (WebCore::IDBDatabaseBackendImpl::PendingOpenWithVersionCall::PendingOpenWithVersionCall):
      (IDBDatabaseBackendImpl::PendingOpenWithVersionCall):
      (WebCore::IDBDatabaseBackendImpl::IDBDatabaseBackendImpl):
      (WebCore::IDBDatabaseBackendImpl::setVersion):
      (WebCore::IDBDatabaseBackendImpl::connectionCount): Don't need to count limbo connections any more.
      (WebCore::IDBDatabaseBackendImpl::processPendingCalls): Pass through db-callbacks.
      (WebCore::IDBDatabaseBackendImpl::openConnection): No more limbo connections (yay!).
      (WebCore::IDBDatabaseBackendImpl::runIntVersionChangeTransaction): Pass through db-callbacks.
      (WebCore::IDBDatabaseBackendImpl::openConnectionWithVersion): Ditto.
      (WebCore::IDBDatabaseBackendImpl::deleteDatabase): Style.
      (WebCore::IDBDatabaseBackendImpl::close): Resolve FIXME about connectionCount.
      * Modules/indexeddb/IDBDatabaseBackendImpl.h:
      (IDBDatabaseBackendImpl):
      * Modules/indexeddb/IDBDatabaseBackendInterface.h:
      (IDBDatabaseBackendInterface):
      * Modules/indexeddb/IDBDatabaseCallbacksImpl.cpp:
      (WebCore::IDBDatabaseCallbacksImpl::create):
      (WebCore::IDBDatabaseCallbacksImpl::IDBDatabaseCallbacksImpl):
      (WebCore::IDBDatabaseCallbacksImpl::connect):
      * Modules/indexeddb/IDBDatabaseCallbacksImpl.h:
      (IDBDatabaseCallbacksImpl):
      * Modules/indexeddb/IDBFactory.cpp:
      (WebCore::IDBFactory::open): Mint the db-callbacks here...
      * Modules/indexeddb/IDBFactoryBackendImpl.cpp:
      (WebCore::IDBFactoryBackendImpl::open): ...passed through to here...
      * Modules/indexeddb/IDBFactoryBackendImpl.h:
      (IDBFactoryBackendImpl):
      * Modules/indexeddb/IDBFactoryBackendInterface.h:
      (IDBFactoryBackendInterface):
      * Modules/indexeddb/IDBOpenDBRequest.cpp:
      (WebCore::IDBOpenDBRequest::create): ...all the way to here...
      (WebCore::IDBOpenDBRequest::IDBOpenDBRequest):
      (WebCore::IDBOpenDBRequest::onUpgradeNeeded): ...and finally hooked up here.
      (WebCore::IDBOpenDBRequest::onSuccess): (or here, if no upgrade needed).
      * Modules/indexeddb/IDBOpenDBRequest.h:
      (WebCore):
      (IDBOpenDBRequest):
      * Modules/indexeddb/IDBTransaction.cpp:
      (WebCore::IDBTransaction::onAbort): Tweak event/notification ordering; the
      notifying the database that the transaction is finished may unblock closing,
      which fires more events, and the delivery matters. Previously the close would
      be blocked by the transaction which gave the desired order.
      (WebCore::IDBTransaction::onComplete): Ditto.
      * inspector/InspectorIndexedDBAgent.cpp: New hookup logic.
      (WebCore):
      
      Source/WebKit/chromium:
      
      API plumbing for simplified single-phase connection opening, and tests updated
      to exercise the new APIs.
      
      * public/WebIDBDatabase.h:
      (WebIDBDatabase): Just a FIXME to remove the old second-phase hookup API.
      * public/WebIDBFactory.h:
      (WebKit):
      (WebIDBFactory):
      (WebKit::WebIDBFactory::open): New overload that takes db-callbacks.
      * src/IDBCallbacksProxy.cpp: The db-callbacks plumbing is needed earlier.
      (WebKit::IDBCallbacksProxy::onSuccess):
      (WebKit::IDBCallbacksProxy::onUpgradeNeeded):
      (WebKit):
      (WebKit::IDBCallbacksProxy::setDatabaseCallbacks): Needs to hold on to
      the db-callbacks and hook it up when the onSuccess callback comes through.
      * src/IDBCallbacksProxy.h:
      (WebKit):
      (IDBCallbacksProxy):
      * src/IDBDatabaseBackendProxy.cpp:
      * src/IDBDatabaseBackendProxy.h:
      (IDBDatabaseBackendProxy):
      * src/IDBFactoryBackendProxy.cpp:
      (WebKit::IDBFactoryBackendProxy::open):
      * src/IDBFactoryBackendProxy.h:
      (IDBFactoryBackendProxy):
      * src/WebIDBDatabaseImpl.cpp:
      (WebKit::WebIDBDatabaseImpl::WebIDBDatabaseImpl):
      (WebKit::WebIDBDatabaseImpl::close):
      * src/WebIDBDatabaseImpl.h:
      (WebIDBDatabaseImpl):
      * src/WebIDBFactoryImpl.cpp:
      (WebKit::WebIDBFactoryImpl::open):
      * src/WebIDBFactoryImpl.h:
      (WebIDBFactoryImpl):
      * tests/IDBAbortOnCorruptTest.cpp:
      (FakeIDBDatabaseCallbacks):
      (WebCore::FakeIDBDatabaseCallbacks::create):
      (WebCore::FakeIDBDatabaseCallbacks::~FakeIDBDatabaseCallbacks):
      (WebCore::FakeIDBDatabaseCallbacks::FakeIDBDatabaseCallbacks):
      (WebCore):
      (WebCore::TEST): Updated connection sequence.
      * tests/IDBDatabaseBackendTest.cpp: Ditto.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128489 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      6bbf86d1
  23. 23 Aug, 2012 1 commit
    • jsbell@chromium.org's avatar
      IndexedDB: Move onSuccess(IDBDatabaseBackendInterface) to IDBOpenDBRequest · c12d8c4e
      jsbell@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=94757
      
      Reviewed by Tony Chang.
      
      Source/WebCore:
      
      Move the implementation of IDBCallbacks::onSuccess(IDBDatabaseBackendInterface)
      from IDBRequest to the new IDBOpenDBRequest, which is the only request type that
      should be receiving that callback.
      
      No new tests - no functional changes.
      
      * Modules/indexeddb/IDBCallbacks.h:
      (IDBCallbacks):
      (WebCore::IDBCallbacks::onSuccess):
      * Modules/indexeddb/IDBOpenDBRequest.cpp:
      (WebCore::IDBOpenDBRequest::onUpgradeNeeded):
      (WebCore::IDBOpenDBRequest::onSuccess):
      (WebCore):
      * Modules/indexeddb/IDBOpenDBRequest.h:
      (IDBOpenDBRequest):
      * Modules/indexeddb/IDBRequest.cpp:
      * Modules/indexeddb/IDBRequest.h:
      
      Source/WebKit/chromium:
      
      Drop onSuccess(IDBDatabaseBackendImpl) overload from test, as it is no longer
      implemented by IDBRequest.
      
      * tests/IDBRequestTest.cpp:
      (WebCore::TEST):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126461 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      c12d8c4e
  24. 16 Aug, 2012 1 commit
    • dgrogan@chromium.org's avatar
      IndexedDB: Frontend and plumbing for integer versions · eb6721b2
      dgrogan@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=92897
      
      Source/WebCore:
      
      Reviewed by Tony Chang.
      
      This patch exposes integer versions and the upgradeneeded event to
      script.
      
      The events surrounding an IDBOpenDBRequest follow a new pattern
      compared to other idb requests. An open request can receive a blocked
      event, an upgradeneeded event, and then a success event. When
      dispatching the upgradeneeded and success events the request has its
      readyState set to DONE and its result property set to an IDBDatabase.
      We usually think of IDBRequests firing one event with one result,
      cursors being the big exception. There are some minor changes around
      enqueuing and dispatching events to support this.
      
      There's also some funkiness in
      IDBRequest::onSuccess(PassRefPtr<IDBDatabaseBackendInterface>) so that
      the IDBDatabase object delivered in upgradeneeded is reused for the
      success event.
      
      Tests - expectations are updated in this patch.
      
      * Modules/indexeddb/IDBDatabase.cpp:
      (WebCore::IDBDatabase::setVersion):
      (WebCore::IDBDatabase::onVersionChange):
      (WebCore):
      (WebCore::IDBDatabase::registerFrontendCallbacks):
      * Modules/indexeddb/IDBDatabase.h:
      (IDBDatabase):
      * Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
      (WebCore::IDBDatabaseBackendImpl::runIntVersionChangeTransaction):
      * Modules/indexeddb/IDBDatabaseCallbacks.h:
      (IDBDatabaseCallbacks):
      * Modules/indexeddb/IDBDatabaseCallbacksImpl.cpp:
      (WebCore::IDBDatabaseCallbacksImpl::onVersionChange):
      (WebCore):
      * Modules/indexeddb/IDBDatabaseCallbacksImpl.h:
      (IDBDatabaseCallbacksImpl):
      * Modules/indexeddb/IDBFactory.cpp:
      (WebCore::IDBFactory::open):
      (WebCore):
      * Modules/indexeddb/IDBFactory.h:
      (IDBFactory):
      * Modules/indexeddb/IDBFactory.idl:
      * Modules/indexeddb/IDBFactoryBackendImpl.cpp:
      (WebCore::IDBFactoryBackendImpl::open):
      * Modules/indexeddb/IDBFactoryBackendImpl.h:
      (IDBFactoryBackendImpl):
      * Modules/indexeddb/IDBFactoryBackendInterface.h:
      (IDBFactoryBackendInterface):
      * Modules/indexeddb/IDBOpenDBRequest.cpp: Added.
      (WebCore):
      (WebCore::IDBOpenDBRequest::create):
      (WebCore::IDBOpenDBRequest::IDBOpenDBRequest):
      (WebCore::IDBOpenDBRequest::~IDBOpenDBRequest):
      (WebCore::IDBOpenDBRequest::interfaceName):
      (WebCore::IDBOpenDBRequest::onBlocked):
      (WebCore::IDBOpenDBRequest::onUpgradeNeeded):
      (WebCore::IDBOpenDBRequest::shouldEnqueueEvent):
      * Modules/indexeddb/IDBOpenDBRequest.h: Copied from Source/WebCore/Modules/indexeddb/IDBDatabaseCallbacksImpl.h.
      (WebCore):
      (IDBOpenDBRequest):
      * Modules/indexeddb/IDBOpenDBRequest.idl: Copied from Source/WebCore/Modules/indexeddb/IDBDatabaseCallbacks.h.
      * Modules/indexeddb/IDBRequest.cpp:
      (WebCore::IDBRequest::IDBRequest):
      (WebCore::IDBRequest::shouldEnqueueEvent):
      (WebCore::IDBRequest::onSuccess):
      This function works with WebIDBCallbacksImpl::onSuccess to reuse its
      IDBDatabaseBackendInterface that it got during
      IDBOpenDBRequest::onUpgradeNeeded.
      
      (WebCore::IDBRequest::dispatchEvent):
      (WebCore::IDBRequest::transactionDidDispatchCompleteOrAbort):
      (WebCore):
      (WebCore::IDBRequest::enqueueEvent):
      * Modules/indexeddb/IDBRequest.h:
      (WebCore::IDBRequest::onBlocked):
      (IDBRequest):
      * Modules/indexeddb/IDBTransaction.cpp:
      We now take a pointer to the openDBRequest if this is a version
      change transaction as a result of an open-with-version call so that we
      can clear the transaction property on the openDBRequest as soon as the
      upgradeneeded event is dispatched per the spec ("... set request's
      transaction property to null... ", currently 4.8.12).
      
      (WebCore::IDBTransaction::create):
      (WebCore):
      (WebCore::IDBTransaction::IDBTransaction):
      (WebCore::IDBTransaction::setActive):
      (WebCore::IDBTransaction::onComplete):
      (WebCore::IDBTransaction::dispatchEvent):
      * Modules/indexeddb/IDBTransaction.h:
      (WebCore):
      (IDBTransaction):
      * Modules/indexeddb/IDBTransactionBackendImpl.cpp:
      (WebCore::IDBTransactionBackendImpl::commit):
      * Modules/indexeddb/IDBUpgradeNeededEvent.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBDatabaseCallbacksImpl.cpp.
      (WebCore):
      (WebCore::IDBUpgradeNeededEvent::create):
      (WebCore::IDBUpgradeNeededEvent::IDBUpgradeNeededEvent):
      (WebCore::IDBUpgradeNeededEvent::~IDBUpgradeNeededEvent):
      (WebCore::IDBUpgradeNeededEvent::oldVersion):
      (WebCore::IDBUpgradeNeededEvent::newVersion):
      (WebCore::IDBUpgradeNeededEvent::interfaceName):
      * Modules/indexeddb/IDBUpgradeNeededEvent.h: Copied from Source/WebKit/chromium/src/WebIDBDatabaseCallbacksImpl.h.
      (WebCore):
      (IDBUpgradeNeededEvent):
      * Modules/indexeddb/IDBUpgradeNeededEvent.idl: Copied from Source/WebCore/Modules/indexeddb/IDBDatabaseCallbacks.h.
      * WebCore.gypi:
      * dom/EventNames.h:
      (WebCore):
      * dom/EventNames.in:
      * dom/EventTargetFactory.in:
      * inspector/InspectorIndexedDBAgent.cpp:
      (WebCore):
      
      Source/WebKit/chromium:
      
      Reviewed by Tony Chang.
      
      * src/IDBCallbacksProxy.cpp:
      (WebKit::IDBCallbacksProxy::onBlocked):
      (WebKit):
      (WebKit::IDBCallbacksProxy::onUpgradeNeeded):
      * src/IDBCallbacksProxy.h:
      (IDBCallbacksProxy):
      * src/IDBDatabaseBackendProxy.cpp:
      (WebKit::IDBDatabaseBackendProxy::setVersion):
      * src/IDBDatabaseCallbacksProxy.cpp:
      (WebKit::IDBDatabaseCallbacksProxy::onVersionChange):
      (WebKit):
      * src/IDBDatabaseCallbacksProxy.h:
      (IDBDatabaseCallbacksProxy):
      * src/IDBFactoryBackendProxy.cpp:
      (WebKit::IDBFactoryBackendProxy::open):
      * src/IDBFactoryBackendProxy.h:
      (IDBFactoryBackendProxy):
      * src/IDBTransactionCallbacksProxy.cpp:
      (WebKit::IDBTransactionCallbacksProxy::onComplete):
      * src/WebIDBCallbacksImpl.cpp:
      (WebKit::WebIDBCallbacksImpl::WebIDBCallbacksImpl):
      (WebKit::WebIDBCallbacksImpl::onSuccess):
      We don't want to create IDBDatabaseBackendProxy again if we've already
      created it during upgradeNeeded.  This makes
      IDBRequest::onSuccess(IDBDatabaseBackend) reuse its previous
      IDBDatabaseBackendInterface if it has one.
      
      (WebKit::WebIDBCallbacksImpl::onBlocked):
      (WebKit):
      (WebKit::WebIDBCallbacksImpl::onUpgradeNeeded):
      * src/WebIDBCallbacksImpl.h:
      (WebIDBCallbacksImpl):
      * src/WebIDBDatabaseCallbacksImpl.cpp:
      (WebKit::WebIDBDatabaseCallbacksImpl::onVersionChange):
      (WebKit):
      * src/WebIDBDatabaseCallbacksImpl.h:
      (WebIDBDatabaseCallbacksImpl):
      * src/WebIDBDatabaseImpl.cpp:
      (WebKit::WebIDBDatabaseImpl::WebIDBDatabaseImpl):
      (WebKit::WebIDBDatabaseImpl::close):
      (WebKit::WebIDBDatabaseImpl::open):
      * src/WebIDBDatabaseImpl.h:
      (WebIDBDatabaseImpl):
      * src/WebIDBFactoryImpl.cpp:
      (WebKit::WebIDBFactoryImpl::open):
      * src/WebIDBFactoryImpl.h:
      (WebIDBFactoryImpl):
      * src/WebIDBTransactionCallbacksImpl.cpp:
      (WebKit::WebIDBTransactionCallbacksImpl::onComplete):
      * tests/IDBAbortOnCorruptTest.cpp:
      (WebCore::TEST):
      * tests/IDBDatabaseBackendTest.cpp:
      
      LayoutTests:
      
      This patch exposes integer versions and the upgradeneeded event to
      script so upgradeneeded events are now fired mostly per expectations.
      This is the bulk of changes to the expected files, further intversion
      patches will change the behavior of a test or two, nothing wholesale.
      
      Reviewed by Tony Chang.
      
      * storage/indexeddb/intversion-abort-in-initial-upgradeneeded-expected.txt:
      * storage/indexeddb/intversion-and-setversion-expected.txt:
      * storage/indexeddb/intversion-blocked-expected.txt:
      * storage/indexeddb/intversion-close-between-events-expected.txt:
      * storage/indexeddb/intversion-close-in-oncomplete-expected.txt:
      * storage/indexeddb/intversion-close-in-upgradeneeded-expected.txt:
      * storage/indexeddb/intversion-gated-on-delete-expected.txt:
      * storage/indexeddb/intversion-invalid-setversion-has-no-side-effects-expected.txt:
      * storage/indexeddb/intversion-long-queue-expected.txt:
      * storage/indexeddb/intversion-open-with-version-expected.txt:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125850 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      eb6721b2