2011-04-05 Hans Wennborg <hans@chromium.org>
authorhans@chromium.org <hans@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 11 Apr 2011 15:56:50 +0000 (15:56 +0000)
committerhans@chromium.org <hans@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 11 Apr 2011 15:56:50 +0000 (15:56 +0000)
commit29c0a38c3ae2ec4542ca65d63d8deea145822011
treefa5d4761ea896e4748638a373b661e8580d34e16
parent7223deb49f060748e396e14bb752c478f9a93b0c
2011-04-05  Hans Wennborg  <hans@chromium.org>

        Reviewed by Steve Block.

        IndexedDB: Introduce skeleton for LevelDB backend
        https://bugs.webkit.org/show_bug.cgi?id=57827

        No new tests: no new functionality (yet).

        * WebCore.gyp/WebCore.gyp:
            Add dependency on leveldb when ENABLE_LEVELDB=1 in feature_defines.
        * WebCore.gypi:
            Add new files.
        * storage/IDBBackingStore.h:
        (WebCore::IDBBackingStore::ObjectStoreRecordIdentifier::~ObjectStoreRecordIdentifier):
            Introduce abstract type ObjectStoreRecordIdentifier. The SQLite
            backend uses integers to refer to a specific row in a table, but
            the LevelDB backend will use something else.
        * storage/IDBDatabaseBackendImpl.cpp:
        (WebCore::IDBDatabaseBackendImpl::createObjectStore):
        (WebCore::IDBDatabaseBackendImpl::createObjectStoreInternal):
        (WebCore::IDBDatabaseBackendImpl::deleteObjectStoreInternal):
        (WebCore::IDBDatabaseBackendImpl::loadObjectStores):
            Change functions to pass along the database id for operations that
            concern object stores. We want to be able to group object stores
            ids per database.
        * storage/IDBFactoryBackendImpl.cpp:
        (WebCore::IDBFactoryBackendImpl::open):
            Decide which backend to use based on the backingStoreType
            parameter.
        * storage/IDBIndexBackendImpl.cpp:
        (WebCore::IDBIndexBackendImpl::IDBIndexBackendImpl):
        (WebCore::IDBIndexBackendImpl::openCursorInternal):
        (WebCore::IDBIndexBackendImpl::getInternal):
        (WebCore::IDBIndexBackendImpl::addingKeyAllowed):
        * storage/IDBIndexBackendImpl.h:
        (WebCore::IDBIndexBackendImpl::create):
            Pass database and object store id to backend functions concerning
            indexes.
        * storage/IDBLevelDBBackingStore.cpp: Added.
        (WebCore::IDBLevelDBBackingStore::IDBLevelDBBackingStore):
        (WebCore::IDBLevelDBBackingStore::~IDBLevelDBBackingStore):
        (WebCore::IDBLevelDBBackingStore::open):
        (WebCore::IDBLevelDBBackingStore::extractIDBDatabaseMetaData):
        (WebCore::IDBLevelDBBackingStore::setIDBDatabaseMetaData):
        (WebCore::IDBLevelDBBackingStore::getObjectStores):
        (WebCore::IDBLevelDBBackingStore::createObjectStore):
        (WebCore::IDBLevelDBBackingStore::deleteObjectStore):
        (WebCore::IDBLevelDBBackingStore::getObjectStoreRecord):
        (WebCore::IDBLevelDBBackingStore::putObjectStoreRecord):
        (WebCore::IDBLevelDBBackingStore::clearObjectStore):
        (WebCore::IDBLevelDBBackingStore::deleteObjectStoreRecord):
        (WebCore::IDBLevelDBBackingStore::nextAutoIncrementNumber):
        (WebCore::IDBLevelDBBackingStore::keyExistsInObjectStore):
        (WebCore::IDBLevelDBBackingStore::forEachObjectStoreRecord):
        (WebCore::IDBLevelDBBackingStore::getIndexes):
        (WebCore::IDBLevelDBBackingStore::createIndex):
        (WebCore::IDBLevelDBBackingStore::deleteIndex):
        (WebCore::IDBLevelDBBackingStore::putIndexDataForRecord):
        (WebCore::IDBLevelDBBackingStore::deleteIndexDataForRecord):
        (WebCore::IDBLevelDBBackingStore::getObjectViaIndex):
        (WebCore::IDBLevelDBBackingStore::getPrimaryKeyViaIndex):
        (WebCore::IDBLevelDBBackingStore::keyExistsInIndex):
        (WebCore::IDBLevelDBBackingStore::openObjectStoreCursor):
        (WebCore::IDBLevelDBBackingStore::openIndexKeyCursor):
        (WebCore::IDBLevelDBBackingStore::openIndexCursor):
        (WebCore::IDBLevelDBBackingStore::createTransaction):
        * storage/IDBLevelDBBackingStore.h: Added.
            Add an empty implementation of the LevelDB backend.
        * storage/IDBObjectStoreBackendImpl.cpp:
            Keep track of database id, use the new RecordIdentifier.
        (WebCore::IDBObjectStoreBackendImpl::IDBObjectStoreBackendImpl):
        (WebCore::IDBObjectStoreBackendImpl::getInternal):
        (WebCore::IDBObjectStoreBackendImpl::putInternal):
        (WebCore::IDBObjectStoreBackendImpl::deleteInternal):
        (WebCore::IDBObjectStoreBackendImpl::clearInternal):
        (WebCore::populateIndex):
        (WebCore::IDBObjectStoreBackendImpl::createIndex):
        (WebCore::IDBObjectStoreBackendImpl::createIndexInternal):
        (WebCore::IDBObjectStoreBackendImpl::deleteIndexInternal):
        (WebCore::IDBObjectStoreBackendImpl::openCursorInternal):
        (WebCore::IDBObjectStoreBackendImpl::loadIndexes):
        (WebCore::IDBObjectStoreBackendImpl::genAutoIncrementKey):
        * storage/IDBObjectStoreBackendImpl.h:
        (WebCore::IDBObjectStoreBackendImpl::create):
        (WebCore::IDBObjectStoreBackendImpl::databaseId):
        * storage/IDBSQLiteBackingStore.cpp:
        (WebCore::IDBSQLiteBackingStore::open):
        (WebCore::IDBSQLiteBackingStore::createObjectStore):
        (WebCore::IDBSQLiteBackingStore::deleteObjectStore):
        (WebCore::IDBSQLiteBackingStore::getObjectStoreRecord):
        (WebCore::IDBSQLiteBackingStore::putObjectStoreRecord):
        (WebCore::IDBSQLiteBackingStore::clearObjectStore):
        (WebCore::IDBSQLiteBackingStore::deleteObjectStoreRecord):
        (WebCore::IDBSQLiteBackingStore::nextAutoIncrementNumber):
        (WebCore::IDBSQLiteBackingStore::keyExistsInObjectStore):
        (WebCore::IDBSQLiteBackingStore::forEachObjectStoreRecord):
        (WebCore::IDBSQLiteBackingStore::getIndexes):
        (WebCore::IDBSQLiteBackingStore::createIndex):
        (WebCore::IDBSQLiteBackingStore::deleteIndex):
        (WebCore::IDBSQLiteBackingStore::putIndexDataForRecord):
        (WebCore::IDBSQLiteBackingStore::deleteIndexDataForRecord):
        (WebCore::IDBSQLiteBackingStore::getObjectViaIndex):
        (WebCore::IDBSQLiteBackingStore::getPrimaryKeyViaIndex):
        (WebCore::IDBSQLiteBackingStore::keyExistsInIndex):
        (WebCore::IDBSQLiteBackingStore::openObjectStoreCursor):
        (WebCore::IDBSQLiteBackingStore::openIndexKeyCursor):
        (WebCore::IDBSQLiteBackingStore::openIndexCursor):
        * storage/IDBSQLiteBackingStore.h:
2011-04-05  Hans Wennborg  <hans@chromium.org>

        Reviewed by Steve Block.

        IndexedDB: Introduce skeleton for LevelDB backend
        https://bugs.webkit.org/show_bug.cgi?id=57827

        * features.gypi:
            Add ENABLE_LEVELDB=0.
        * public/WebIDBFactory.h:
        (WebKit::WebIDBFactory::open):
            Remove pre-roll open() function.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@83443 268f45cc-cd09-0410-ab3c-d52691b4dbfc
17 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.gyp/WebCore.gyp
Source/WebCore/WebCore.gypi
Source/WebCore/storage/IDBBackingStore.h
Source/WebCore/storage/IDBDatabaseBackendImpl.cpp
Source/WebCore/storage/IDBFactoryBackendImpl.cpp
Source/WebCore/storage/IDBIndexBackendImpl.cpp
Source/WebCore/storage/IDBIndexBackendImpl.h
Source/WebCore/storage/IDBLevelDBBackingStore.cpp [new file with mode: 0644]
Source/WebCore/storage/IDBLevelDBBackingStore.h [new file with mode: 0644]
Source/WebCore/storage/IDBObjectStoreBackendImpl.cpp
Source/WebCore/storage/IDBObjectStoreBackendImpl.h
Source/WebCore/storage/IDBSQLiteBackingStore.cpp
Source/WebCore/storage/IDBSQLiteBackingStore.h
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/features.gypi
Source/WebKit/chromium/public/WebIDBFactory.h