IndexedDB: add methods to support id-based backend APIs
authoralecflett@chromium.org <alecflett@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 1 Nov 2012 01:21:41 +0000 (01:21 +0000)
committeralecflett@chromium.org <alecflett@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 1 Nov 2012 01:21:41 +0000 (01:21 +0000)
commit5748cab0cc7ffbcb6b51a5b2098a0fb13981355a
tree8a1fe9a5cff629b2e2f19cccb184713d6d69366d
parent5c42cdd1833d661844c4bab363e99701e85e207d
IndexedDB: add methods to support id-based backend APIs
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: https://svn.webkit.org/repository/webkit/trunk@133107 268f45cc-cd09-0410-ab3c-d52691b4dbfc
43 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Modules/indexeddb/IDBCallbacks.h
Source/WebCore/Modules/indexeddb/IDBDatabase.cpp
Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.cpp
Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.h
Source/WebCore/Modules/indexeddb/IDBDatabaseBackendInterface.h
Source/WebCore/Modules/indexeddb/IDBFactory.cpp
Source/WebCore/Modules/indexeddb/IDBFactory.h
Source/WebCore/Modules/indexeddb/IDBIndex.h
Source/WebCore/Modules/indexeddb/IDBIndexBackendInterface.h
Source/WebCore/Modules/indexeddb/IDBKeyPath.cpp
Source/WebCore/Modules/indexeddb/IDBMetadata.h
Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp
Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendImpl.cpp
Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendImpl.h
Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendInterface.h
Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.cpp
Source/WebCore/Modules/indexeddb/IDBRequest.cpp
Source/WebCore/Modules/indexeddb/IDBTransaction.cpp
Source/WebCore/Modules/indexeddb/IDBTransaction.h
Source/WebCore/Modules/indexeddb/IDBTransactionBackendImpl.cpp
Source/WebCore/Modules/indexeddb/IDBTransactionBackendImpl.h
Source/WebCore/Modules/indexeddb/IDBTransactionBackendInterface.h
Source/WebCore/Modules/indexeddb/IDBTransactionCoordinator.h
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/public/WebIDBDatabase.h
Source/WebKit/chromium/public/WebIDBObjectStore.h
Source/WebKit/chromium/public/WebIDBTransaction.h
Source/WebKit/chromium/src/IDBDatabaseBackendProxy.cpp
Source/WebKit/chromium/src/IDBDatabaseBackendProxy.h
Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.cpp
Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.h
Source/WebKit/chromium/src/IDBTransactionBackendProxy.cpp
Source/WebKit/chromium/src/IDBTransactionBackendProxy.h
Source/WebKit/chromium/src/WebIDBCallbacksImpl.cpp
Source/WebKit/chromium/src/WebIDBDatabaseImpl.cpp
Source/WebKit/chromium/src/WebIDBDatabaseImpl.h
Source/WebKit/chromium/src/WebIDBMetadata.cpp
Source/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp
Source/WebKit/chromium/src/WebIDBObjectStoreImpl.h
Source/WebKit/chromium/src/WebIDBTransactionImpl.cpp
Source/WebKit/chromium/src/WebIDBTransactionImpl.h
Source/WebKit/chromium/tests/IDBDatabaseBackendTest.cpp