Changeset 129066 in webkit


Ignore:
Timestamp:
Sep 19, 2012 4:27:20 PM (12 years ago)
Author:
jsbell@chromium.org
Message:

IndexedDB: Remove "current transaction" concept from backing store
https://bugs.webkit.org/show_bug.cgi?id=96663

Reviewed by Tony Chang.

Source/WebCore:

IndexedDB should allow multiple transactions to run in parallel within and
across databases within an origin. As an initial step to enabling this, the
backing store should not hold a "current transaction" - instead, operations
should be done relative to a transaction managed by the database.

No new tests - no functional changes.

  • Modules/indexeddb/IDBBackingStore.h:

(IDBBackingStore):

  • Modules/indexeddb/IDBDatabaseBackendImpl.cpp:

(WebCore::IDBDatabaseBackendImpl::createObjectStoreInternal):
(WebCore::IDBDatabaseBackendImpl::deleteObjectStoreInternal):
(WebCore::IDBDatabaseBackendImpl::setVersionInternal):
(WebCore::IDBDatabaseBackendImpl::setIntVersionInternal):

  • Modules/indexeddb/IDBDatabaseBackendImpl.h:

(IDBDatabaseBackendImpl):

  • Modules/indexeddb/IDBIndexBackendImpl.cpp:

(WebCore::IDBIndexBackendImpl::openCursorInternal):
(WebCore::IDBIndexBackendImpl::countInternal):
(WebCore::IDBIndexBackendImpl::count):
(WebCore::IDBIndexBackendImpl::getInternal):
(WebCore::IDBIndexBackendImpl::getKeyInternal):
(WebCore::IDBIndexBackendImpl::get):
(WebCore::IDBIndexBackendImpl::getKey):

  • Modules/indexeddb/IDBIndexBackendImpl.h:

(IDBIndexBackendImpl):

  • Modules/indexeddb/IDBLevelDBBackingStore.cpp:

(WebCore::IDBLevelDBBackingStore::updateIDBDatabaseIntVersion):
(WebCore::IDBLevelDBBackingStore::updateIDBDatabaseMetaData):
(WebCore::IDBLevelDBBackingStore::createObjectStore):
(WebCore::IDBLevelDBBackingStore::deleteObjectStore):
(WebCore::IDBLevelDBBackingStore::getObjectStoreRecord):
(WebCore):
(WebCore::IDBLevelDBBackingStore::putObjectStoreRecord):
(WebCore::IDBLevelDBBackingStore::clearObjectStore):
(WebCore::IDBLevelDBBackingStore::deleteObjectStoreRecord):
(WebCore::IDBLevelDBBackingStore::getKeyGeneratorCurrentNumber):
(WebCore::IDBLevelDBBackingStore::maybeUpdateKeyGeneratorCurrentNumber):
(WebCore::IDBLevelDBBackingStore::keyExistsInObjectStore):
(WebCore::IDBLevelDBBackingStore::forEachObjectStoreRecord):
(WebCore::IDBLevelDBBackingStore::createIndex):
(WebCore::IDBLevelDBBackingStore::deleteIndex):
(WebCore::IDBLevelDBBackingStore::putIndexDataForRecord):
(WebCore::IDBLevelDBBackingStore::deleteIndexDataForRecord):
(WebCore::IDBLevelDBBackingStore::findKeyInIndex):
(WebCore::IDBLevelDBBackingStore::getPrimaryKeyViaIndex):
(WebCore::IDBLevelDBBackingStore::keyExistsInIndex):
(WebCore::IDBLevelDBBackingStore::openObjectStoreCursor):
(WebCore::IDBLevelDBBackingStore::openObjectStoreKeyCursor):
(WebCore::IDBLevelDBBackingStore::openIndexKeyCursor):
(WebCore::IDBLevelDBBackingStore::openIndexCursor):
(WebCore::IDBLevelDBBackingStore::Transaction::Transaction):
(WebCore::IDBLevelDBBackingStore::Transaction::begin):
(WebCore::IDBLevelDBBackingStore::Transaction::commit):
(WebCore::IDBLevelDBBackingStore::Transaction::rollback):

  • Modules/indexeddb/IDBLevelDBBackingStore.h:

(IDBLevelDBBackingStore):
(WebCore::IDBLevelDBBackingStore::Transaction::levelDBTransaction):
(Transaction):
(WebCore::IDBLevelDBBackingStore::Transaction::levelDBTransactionFrom):

  • Modules/indexeddb/IDBObjectStoreBackendImpl.cpp:

(WebCore::IDBObjectStoreBackendImpl::get):
(WebCore::IDBObjectStoreBackendImpl::getInternal):
(WebCore):
(WebCore::makeIndexWriters):
(WebCore::IDBObjectStoreBackendImpl::setIndexKeys):
(WebCore::IDBObjectStoreBackendImpl::putInternal):
(WebCore::IDBObjectStoreBackendImpl::deleteFunction):
(WebCore::IDBObjectStoreBackendImpl::deleteInternal):
(WebCore::IDBObjectStoreBackendImpl::clear):
(WebCore::IDBObjectStoreBackendImpl::clearInternal):
(WebCore::IDBObjectStoreBackendImpl::createIndexInternal):
(WebCore::IDBObjectStoreBackendImpl::deleteIndexInternal):
(WebCore::IDBObjectStoreBackendImpl::openCursorInternal):
(WebCore::IDBObjectStoreBackendImpl::count):
(WebCore::IDBObjectStoreBackendImpl::countInternal):
(WebCore::IDBObjectStoreBackendImpl::generateKey):
(WebCore::IDBObjectStoreBackendImpl::updateKeyGenerator):

  • Modules/indexeddb/IDBObjectStoreBackendImpl.h:

(IDBObjectStoreBackendImpl):

Source/WebKit/chromium:

Update fake class with new method signatures.

  • tests/IDBFakeBackingStore.h:
Location:
trunk/Source
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r129054 r129066  
     12012-09-19  Joshua Bell  <jsbell@chromium.org>
     2
     3        IndexedDB: Remove "current transaction" concept from backing store
     4        https://bugs.webkit.org/show_bug.cgi?id=96663
     5
     6        Reviewed by Tony Chang.
     7
     8        IndexedDB should allow multiple transactions to run in parallel within and
     9        across databases within an origin. As an initial step to enabling this, the
     10        backing store should not hold a "current transaction" - instead, operations
     11        should be done relative to a transaction managed by the database.
     12
     13        No new tests - no functional changes.
     14
     15        * Modules/indexeddb/IDBBackingStore.h:
     16        (IDBBackingStore):
     17        * Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
     18        (WebCore::IDBDatabaseBackendImpl::createObjectStoreInternal):
     19        (WebCore::IDBDatabaseBackendImpl::deleteObjectStoreInternal):
     20        (WebCore::IDBDatabaseBackendImpl::setVersionInternal):
     21        (WebCore::IDBDatabaseBackendImpl::setIntVersionInternal):
     22        * Modules/indexeddb/IDBDatabaseBackendImpl.h:
     23        (IDBDatabaseBackendImpl):
     24        * Modules/indexeddb/IDBIndexBackendImpl.cpp:
     25        (WebCore::IDBIndexBackendImpl::openCursorInternal):
     26        (WebCore::IDBIndexBackendImpl::countInternal):
     27        (WebCore::IDBIndexBackendImpl::count):
     28        (WebCore::IDBIndexBackendImpl::getInternal):
     29        (WebCore::IDBIndexBackendImpl::getKeyInternal):
     30        (WebCore::IDBIndexBackendImpl::get):
     31        (WebCore::IDBIndexBackendImpl::getKey):
     32        * Modules/indexeddb/IDBIndexBackendImpl.h:
     33        (IDBIndexBackendImpl):
     34        * Modules/indexeddb/IDBLevelDBBackingStore.cpp:
     35        (WebCore::IDBLevelDBBackingStore::updateIDBDatabaseIntVersion):
     36        (WebCore::IDBLevelDBBackingStore::updateIDBDatabaseMetaData):
     37        (WebCore::IDBLevelDBBackingStore::createObjectStore):
     38        (WebCore::IDBLevelDBBackingStore::deleteObjectStore):
     39        (WebCore::IDBLevelDBBackingStore::getObjectStoreRecord):
     40        (WebCore):
     41        (WebCore::IDBLevelDBBackingStore::putObjectStoreRecord):
     42        (WebCore::IDBLevelDBBackingStore::clearObjectStore):
     43        (WebCore::IDBLevelDBBackingStore::deleteObjectStoreRecord):
     44        (WebCore::IDBLevelDBBackingStore::getKeyGeneratorCurrentNumber):
     45        (WebCore::IDBLevelDBBackingStore::maybeUpdateKeyGeneratorCurrentNumber):
     46        (WebCore::IDBLevelDBBackingStore::keyExistsInObjectStore):
     47        (WebCore::IDBLevelDBBackingStore::forEachObjectStoreRecord):
     48        (WebCore::IDBLevelDBBackingStore::createIndex):
     49        (WebCore::IDBLevelDBBackingStore::deleteIndex):
     50        (WebCore::IDBLevelDBBackingStore::putIndexDataForRecord):
     51        (WebCore::IDBLevelDBBackingStore::deleteIndexDataForRecord):
     52        (WebCore::IDBLevelDBBackingStore::findKeyInIndex):
     53        (WebCore::IDBLevelDBBackingStore::getPrimaryKeyViaIndex):
     54        (WebCore::IDBLevelDBBackingStore::keyExistsInIndex):
     55        (WebCore::IDBLevelDBBackingStore::openObjectStoreCursor):
     56        (WebCore::IDBLevelDBBackingStore::openObjectStoreKeyCursor):
     57        (WebCore::IDBLevelDBBackingStore::openIndexKeyCursor):
     58        (WebCore::IDBLevelDBBackingStore::openIndexCursor):
     59        (WebCore::IDBLevelDBBackingStore::Transaction::Transaction):
     60        (WebCore::IDBLevelDBBackingStore::Transaction::begin):
     61        (WebCore::IDBLevelDBBackingStore::Transaction::commit):
     62        (WebCore::IDBLevelDBBackingStore::Transaction::rollback):
     63        * Modules/indexeddb/IDBLevelDBBackingStore.h:
     64        (IDBLevelDBBackingStore):
     65        (WebCore::IDBLevelDBBackingStore::Transaction::levelDBTransaction):
     66        (Transaction):
     67        (WebCore::IDBLevelDBBackingStore::Transaction::levelDBTransactionFrom):
     68        * Modules/indexeddb/IDBObjectStoreBackendImpl.cpp:
     69        (WebCore::IDBObjectStoreBackendImpl::get):
     70        (WebCore::IDBObjectStoreBackendImpl::getInternal):
     71        (WebCore):
     72        (WebCore::makeIndexWriters):
     73        (WebCore::IDBObjectStoreBackendImpl::setIndexKeys):
     74        (WebCore::IDBObjectStoreBackendImpl::putInternal):
     75        (WebCore::IDBObjectStoreBackendImpl::deleteFunction):
     76        (WebCore::IDBObjectStoreBackendImpl::deleteInternal):
     77        (WebCore::IDBObjectStoreBackendImpl::clear):
     78        (WebCore::IDBObjectStoreBackendImpl::clearInternal):
     79        (WebCore::IDBObjectStoreBackendImpl::createIndexInternal):
     80        (WebCore::IDBObjectStoreBackendImpl::deleteIndexInternal):
     81        (WebCore::IDBObjectStoreBackendImpl::openCursorInternal):
     82        (WebCore::IDBObjectStoreBackendImpl::count):
     83        (WebCore::IDBObjectStoreBackendImpl::countInternal):
     84        (WebCore::IDBObjectStoreBackendImpl::generateKey):
     85        (WebCore::IDBObjectStoreBackendImpl::updateKeyGenerator):
     86        * Modules/indexeddb/IDBObjectStoreBackendImpl.h:
     87        (IDBObjectStoreBackendImpl):
     88
    1892012-09-19  Terry Anderson  <tdanderson@chromium.org>
    290
  • trunk/Source/WebCore/Modules/indexeddb/IDBBackingStore.h

    r128217 r129066  
    4545class IDBBackingStore : public RefCounted<IDBBackingStore> {
    4646public:
     47    class Transaction;
     48
    4749    virtual ~IDBBackingStore() {};
    4850
     
    5052    virtual bool getIDBDatabaseMetaData(const String& name, String& foundStringVersion, int64_t& foundIntVersion, int64_t& foundId) = 0;
    5153    virtual bool createIDBDatabaseMetaData(const String& name, const String& stringVersion, int64_t intVersion, int64_t& rowId) = 0;
    52     virtual bool updateIDBDatabaseIntVersion(int64_t rowId, int64_t intVersion) = 0;
    53     virtual bool updateIDBDatabaseMetaData(int64_t rowId, const String& version) = 0;
     54    virtual bool updateIDBDatabaseIntVersion(Transaction*, int64_t rowId, int64_t intVersion) = 0;
     55    virtual bool updateIDBDatabaseMetaData(Transaction*, int64_t rowId, const String& version) = 0;
    5456    virtual bool deleteDatabase(const String& name) = 0;
    5557
    5658    virtual void getObjectStores(int64_t databaseId, Vector<int64_t>& foundIds, Vector<String>& foundNames, Vector<IDBKeyPath>& foundKeyPaths, Vector<bool>& foundAutoIncrementFlags) = 0;
    57     virtual bool createObjectStore(int64_t databaseId, const String& name, const IDBKeyPath&, bool autoIncrement, int64_t& assignedObjectStoreId) = 0;
    58     virtual void deleteObjectStore(int64_t databaseId, int64_t objectStoreId) = 0;
     59    virtual bool createObjectStore(Transaction*, int64_t databaseId, const String& name, const IDBKeyPath&, bool autoIncrement, int64_t& assignedObjectStoreId) = 0;
     60    virtual void deleteObjectStore(Transaction*, int64_t databaseId, int64_t objectStoreId) = 0;
    5961
    6062    class ObjectStoreRecordIdentifier : public RefCounted<ObjectStoreRecordIdentifier> {
     
    6567    virtual PassRefPtr<ObjectStoreRecordIdentifier> createInvalidRecordIdentifier() = 0;
    6668
    67     virtual String getObjectStoreRecord(int64_t databaseId, int64_t objectStoreId, const IDBKey&) = 0;
    68     virtual bool putObjectStoreRecord(int64_t databaseId, int64_t objectStoreId, const IDBKey&, const String& value, ObjectStoreRecordIdentifier*) = 0;
    69     virtual void clearObjectStore(int64_t databaseId, int64_t objectStoreId) = 0;
    70     virtual void deleteObjectStoreRecord(int64_t databaseId, int64_t objectStoreId, const ObjectStoreRecordIdentifier*) = 0;
    71     virtual int64_t getKeyGeneratorCurrentNumber(int64_t databaseId, int64_t objectStoreId) = 0;
    72     virtual bool maybeUpdateKeyGeneratorCurrentNumber(int64_t databaseId, int64_t objectStoreId, int64_t newNumber, bool checkCurrent) = 0;
    73     virtual bool keyExistsInObjectStore(int64_t databaseId, int64_t objectStoreId, const IDBKey&, ObjectStoreRecordIdentifier* foundRecordIdentifier) = 0;
     69    virtual String getObjectStoreRecord(Transaction*, int64_t databaseId, int64_t objectStoreId, const IDBKey&) = 0;
     70    virtual bool putObjectStoreRecord(Transaction*, int64_t databaseId, int64_t objectStoreId, const IDBKey&, const String& value, ObjectStoreRecordIdentifier*) = 0;
     71    virtual void clearObjectStore(Transaction*, int64_t databaseId, int64_t objectStoreId) = 0;
     72    virtual void deleteObjectStoreRecord(Transaction*, int64_t databaseId, int64_t objectStoreId, const ObjectStoreRecordIdentifier*) = 0;
     73    virtual int64_t getKeyGeneratorCurrentNumber(Transaction*, int64_t databaseId, int64_t objectStoreId) = 0;
     74    virtual bool maybeUpdateKeyGeneratorCurrentNumber(Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t newNumber, bool checkCurrent) = 0;
     75    virtual bool keyExistsInObjectStore(Transaction*, int64_t databaseId, int64_t objectStoreId, const IDBKey&, ObjectStoreRecordIdentifier* foundRecordIdentifier) = 0;
    7476
    7577    class ObjectStoreRecordCallback {
     
    7880         virtual ~ObjectStoreRecordCallback() {};
    7981    };
    80     virtual bool forEachObjectStoreRecord(int64_t databaseId, int64_t objectStoreId, ObjectStoreRecordCallback&) = 0;
     82    virtual bool forEachObjectStoreRecord(Transaction*, int64_t databaseId, int64_t objectStoreId, ObjectStoreRecordCallback&) = 0;
    8183
    8284    virtual void getIndexes(int64_t databaseId, int64_t objectStoreId, Vector<int64_t>& foundIds, Vector<String>& foundNames, Vector<IDBKeyPath>& foundKeyPaths, Vector<bool>& foundUniqueFlags, Vector<bool>& foundMultiEntryFlags) = 0;
    83     virtual bool createIndex(int64_t databaseId, int64_t objectStoreId, const String& name, const IDBKeyPath&, bool isUnique, bool isMultiEntry, int64_t& indexId) = 0;
    84     virtual void deleteIndex(int64_t databaseId, int64_t objectStoreId, int64_t indexId) = 0;
    85     virtual bool putIndexDataForRecord(int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey&, const ObjectStoreRecordIdentifier*) = 0;
    86     virtual bool deleteIndexDataForRecord(int64_t databaseId, int64_t objectStoreId, int64_t indexId, const ObjectStoreRecordIdentifier*) = 0;
    87     virtual PassRefPtr<IDBKey> getPrimaryKeyViaIndex(int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey&) = 0;
    88     virtual bool keyExistsInIndex(int64_t databaseid, int64_t objectStoreId, int64_t indexId, const IDBKey& indexKey, RefPtr<IDBKey>& foundPrimaryKey) = 0;
     85    virtual bool createIndex(Transaction*, int64_t databaseId, int64_t objectStoreId, const String& name, const IDBKeyPath&, bool isUnique, bool isMultiEntry, int64_t& indexId) = 0;
     86    virtual void deleteIndex(Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId) = 0;
     87    virtual bool putIndexDataForRecord(Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey&, const ObjectStoreRecordIdentifier*) = 0;
     88    virtual bool deleteIndexDataForRecord(Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const ObjectStoreRecordIdentifier*) = 0;
     89    virtual PassRefPtr<IDBKey> getPrimaryKeyViaIndex(Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey&) = 0;
     90    virtual bool keyExistsInIndex(Transaction*, int64_t databaseid, int64_t objectStoreId, int64_t indexId, const IDBKey& indexKey, RefPtr<IDBKey>& foundPrimaryKey) = 0;
    8991
    9092    class Cursor : public RefCounted<Cursor> {
     
    106108    };
    107109
    108     virtual PassRefPtr<Cursor> openObjectStoreCursor(int64_t databaseId, int64_t objectStoreId, const IDBKeyRange*, IDBCursor::Direction) = 0;
    109     virtual PassRefPtr<Cursor> openObjectStoreKeyCursor(int64_t databaseId, int64_t objectStoreId, const IDBKeyRange*, IDBCursor::Direction) = 0;
    110     virtual PassRefPtr<Cursor> openIndexKeyCursor(int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKeyRange*, IDBCursor::Direction) = 0;
    111     virtual PassRefPtr<Cursor> openIndexCursor(int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKeyRange*, IDBCursor::Direction) = 0;
     110    virtual PassRefPtr<Cursor> openObjectStoreCursor(Transaction*, int64_t databaseId, int64_t objectStoreId, const IDBKeyRange*, IDBCursor::Direction) = 0;
     111    virtual PassRefPtr<Cursor> openObjectStoreKeyCursor(Transaction*, int64_t databaseId, int64_t objectStoreId, const IDBKeyRange*, IDBCursor::Direction) = 0;
     112    virtual PassRefPtr<Cursor> openIndexKeyCursor(Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKeyRange*, IDBCursor::Direction) = 0;
     113    virtual PassRefPtr<Cursor> openIndexCursor(Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKeyRange*, IDBCursor::Direction) = 0;
    112114
    113115    class Transaction : public RefCounted<Transaction> {
  • trunk/Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.cpp

    r129037 r129066  
    195195}
    196196
    197 void IDBDatabaseBackendImpl::createObjectStoreInternal(ScriptExecutionContext*, PassRefPtr<IDBDatabaseBackendImpl> database, PassRefPtr<IDBObjectStoreBackendImpl> objectStore,  PassRefPtr<IDBTransactionBackendImpl> transaction)
     197void IDBDatabaseBackendImpl::createObjectStoreInternal(ScriptExecutionContext*, PassRefPtr<IDBDatabaseBackendImpl> database, PassRefPtr<IDBObjectStoreBackendImpl> objectStore, PassRefPtr<IDBTransactionBackendImpl> transaction)
    198198{
    199199    int64_t objectStoreId;
    200200
    201     if (!database->m_backingStore->createObjectStore(database->id(), objectStore->name(), objectStore->keyPath(), objectStore->autoIncrement(), objectStoreId)) {
     201    if (!database->m_backingStore->createObjectStore(transaction->backingStoreTransaction(), database->id(), objectStore->name(), objectStore->keyPath(), objectStore->autoIncrement(), objectStoreId)) {
    202202        transaction->abort();
    203203        return;
     
    233233void IDBDatabaseBackendImpl::deleteObjectStoreInternal(ScriptExecutionContext*, PassRefPtr<IDBDatabaseBackendImpl> database, PassRefPtr<IDBObjectStoreBackendImpl> objectStore, PassRefPtr<IDBTransactionBackendImpl> transaction)
    234234{
    235     database->m_backingStore->deleteObjectStore(database->id(), objectStore->id());
     235    database->m_backingStore->deleteObjectStore(transaction->backingStoreTransaction(), database->id(), objectStore->id());
    236236    transaction->didCompleteTaskEvents();
    237237}
     
    286286    database->m_version = version;
    287287    database->m_intVersion = IDBDatabaseMetadata::NoIntVersion;
    288     if (!database->m_backingStore->updateIDBDatabaseMetaData(databaseId, database->m_version) || !database->m_backingStore->updateIDBDatabaseIntVersion(databaseId, database->m_intVersion)) {
     288    if (!database->m_backingStore->updateIDBDatabaseMetaData(transaction->backingStoreTransaction(), databaseId, database->m_version) || !database->m_backingStore->updateIDBDatabaseIntVersion(transaction->backingStoreTransaction(), databaseId, database->m_intVersion)) {
    289289        callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::UNKNOWN_ERR, "Error writing data to stable storage."));
    290290        transaction->abort();
     
    294294}
    295295
    296 void IDBDatabaseBackendImpl::setIntVersionInternal(ScriptExecutionContext*, PassRefPtr<IDBDatabaseBackendImpl> database, int64_t version, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<IDBTransactionBackendInterface> transaction)
     296void IDBDatabaseBackendImpl::setIntVersionInternal(ScriptExecutionContext*, PassRefPtr<IDBDatabaseBackendImpl> database, int64_t version, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<IDBTransactionBackendImpl> transaction)
    297297{
    298298    int64_t databaseId = database->id();
     
    300300    ASSERT(version > oldVersion);
    301301    database->m_intVersion = version;
    302     if (!database->m_backingStore->updateIDBDatabaseIntVersion(databaseId, database->m_intVersion)) {
     302    if (!database->m_backingStore->updateIDBDatabaseIntVersion(transaction->backingStoreTransaction(), databaseId, database->m_intVersion)) {
    303303        callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::UNKNOWN_ERR, "Error writing data to stable storage."));
    304304        transaction->abort();
  • trunk/Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.h

    r129037 r129066  
    8787    static void deleteObjectStoreInternal(ScriptExecutionContext*, PassRefPtr<IDBDatabaseBackendImpl>, PassRefPtr<IDBObjectStoreBackendImpl>, PassRefPtr<IDBTransactionBackendImpl>);
    8888    static void setVersionInternal(ScriptExecutionContext*, PassRefPtr<IDBDatabaseBackendImpl>, const String& version, PassRefPtr<IDBCallbacks>, PassRefPtr<IDBTransactionBackendImpl>);
    89     static void setIntVersionInternal(ScriptExecutionContext*, PassRefPtr<IDBDatabaseBackendImpl>, int64_t version, PassRefPtr<IDBCallbacks>, PassRefPtr<IDBTransactionBackendInterface>);
     89    static void setIntVersionInternal(ScriptExecutionContext*, PassRefPtr<IDBDatabaseBackendImpl>, int64_t version, PassRefPtr<IDBCallbacks>, PassRefPtr<IDBTransactionBackendImpl>);
    9090
    9191    // These are used as setVersion transaction abort tasks.
  • trunk/Source/WebCore/Modules/indexeddb/IDBIndexBackendImpl.cpp

    r125568 r129066  
    8484    switch (cursorType) {
    8585    case IDBCursorBackendInterface::IndexKeyCursor:
    86         backingStoreCursor = index->backingStore()->openIndexKeyCursor(index->databaseId(), index->m_objectStoreBackend->id(), index->id(), range.get(), direction);
     86        backingStoreCursor = index->backingStore()->openIndexKeyCursor(transaction->backingStoreTransaction(), index->databaseId(), index->m_objectStoreBackend->id(), index->id(), range.get(), direction);
    8787        break;
    8888    case IDBCursorBackendInterface::IndexCursor:
    89         backingStoreCursor = index->backingStore()->openIndexCursor(index->databaseId(), index->m_objectStoreBackend->id(), index->id(), range.get(), direction);
     89        backingStoreCursor = index->backingStore()->openIndexCursor(transaction->backingStoreTransaction(), index->databaseId(), index->m_objectStoreBackend->id(), index->id(), range.get(), direction);
    9090        break;
    9191    case IDBCursorBackendInterface::ObjectStoreCursor:
     
    128128}
    129129
    130 void IDBIndexBackendImpl::countInternal(ScriptExecutionContext*, PassRefPtr<IDBIndexBackendImpl> index, PassRefPtr<IDBKeyRange> range, PassRefPtr<IDBCallbacks> callbacks)
     130void IDBIndexBackendImpl::countInternal(ScriptExecutionContext*, PassRefPtr<IDBIndexBackendImpl> index, PassRefPtr<IDBKeyRange> range, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<IDBTransactionBackendImpl> transaction)
    131131{
    132132    IDB_TRACE("IDBIndexBackendImpl::countInternal");
    133133    uint32_t count = 0;
    134134
    135     RefPtr<IDBBackingStore::Cursor> backingStoreCursor = index->backingStore()->openIndexKeyCursor(index->databaseId(), index->m_objectStoreBackend->id(), index->id(), range.get(), IDBCursor::NEXT);
     135    RefPtr<IDBBackingStore::Cursor> backingStoreCursor = index->backingStore()->openIndexKeyCursor(transaction->backingStoreTransaction(), index->databaseId(), index->m_objectStoreBackend->id(), index->id(), range.get(), IDBCursor::NEXT);
    136136    if (!backingStoreCursor) {
    137137        callbacks->onSuccess(SerializedScriptValue::numberValue(count));
     
    146146}
    147147
    148 void IDBIndexBackendImpl::count(PassRefPtr<IDBKeyRange> range, PassRefPtr<IDBCallbacks> callbacks, IDBTransactionBackendInterface* transaction, ExceptionCode& ec)
     148void IDBIndexBackendImpl::count(PassRefPtr<IDBKeyRange> range, PassRefPtr<IDBCallbacks> callbacks, IDBTransactionBackendInterface* transactionPtr, ExceptionCode& ec)
    149149{
    150150    IDB_TRACE("IDBIndexBackendImpl::count");
    151     if (!IDBTransactionBackendImpl::from(transaction)->scheduleTask(
    152             createCallbackTask(&countInternal, this, range, callbacks)))
    153         ec = IDBDatabaseException::TRANSACTION_INACTIVE_ERR;
    154 }
    155 
    156 void IDBIndexBackendImpl::getInternal(ScriptExecutionContext*, PassRefPtr<IDBIndexBackendImpl> index, PassRefPtr<IDBKeyRange> keyRange, PassRefPtr<IDBCallbacks> callbacks)
     151    RefPtr<IDBTransactionBackendImpl> transaction = IDBTransactionBackendImpl::from(transactionPtr);
     152    if (!transaction->scheduleTask(
     153            createCallbackTask(&countInternal, this, range, callbacks, transaction)))
     154        ec = IDBDatabaseException::TRANSACTION_INACTIVE_ERR;
     155}
     156
     157void IDBIndexBackendImpl::getInternal(ScriptExecutionContext*, PassRefPtr<IDBIndexBackendImpl> index, PassRefPtr<IDBKeyRange> keyRange, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<IDBTransactionBackendImpl> transaction)
    157158{
    158159    IDB_TRACE("IDBIndexBackendImpl::getInternal");
     
    163164        key = keyRange->lower();
    164165    else {
    165         RefPtr<IDBBackingStore::Cursor> backingStoreCursor = index->backingStore()->openIndexCursor(index->databaseId(), index->m_objectStoreBackend->id(), index->id(), keyRange.get(), IDBCursor::NEXT);
     166        RefPtr<IDBBackingStore::Cursor> backingStoreCursor = index->backingStore()->openIndexCursor(transaction->backingStoreTransaction(), index->databaseId(), index->m_objectStoreBackend->id(), index->id(), keyRange.get(), IDBCursor::NEXT);
    166167
    167168        if (!backingStoreCursor) {
     
    173174    }
    174175
    175     RefPtr<IDBKey> primaryKey = index->backingStore()->getPrimaryKeyViaIndex(index->databaseId(), index->m_objectStoreBackend->id(), index->id(), *key);
    176 
    177     String value = index->backingStore()->getObjectStoreRecord(index->databaseId(), index->m_objectStoreBackend->id(), *primaryKey);
     176    RefPtr<IDBKey> primaryKey = index->backingStore()->getPrimaryKeyViaIndex(transaction->backingStoreTransaction(), index->databaseId(), index->m_objectStoreBackend->id(), index->id(), *key);
     177
     178    String value = index->backingStore()->getObjectStoreRecord(transaction->backingStoreTransaction(), index->databaseId(), index->m_objectStoreBackend->id(), *primaryKey);
    178179
    179180    if (value.isNull()) {
     
    189190}
    190191
    191 void IDBIndexBackendImpl::getKeyInternal(ScriptExecutionContext* context, PassRefPtr<IDBIndexBackendImpl> index, PassRefPtr<IDBKeyRange> keyRange, PassRefPtr<IDBCallbacks> callbacks)
     192void IDBIndexBackendImpl::getKeyInternal(ScriptExecutionContext* context, PassRefPtr<IDBIndexBackendImpl> index, PassRefPtr<IDBKeyRange> keyRange, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<IDBTransactionBackendImpl> transaction)
    192193{
    193194    IDB_TRACE("IDBIndexBackendImpl::getInternal");
    194195
    195196    RefPtr<IDBBackingStore::Cursor> backingStoreCursor =
    196             index->backingStore()->openIndexKeyCursor(index->databaseId(), index->m_objectStoreBackend->id(), index->id(), keyRange.get(), IDBCursor::NEXT);
     197            index->backingStore()->openIndexKeyCursor(transaction->backingStoreTransaction(), index->databaseId(), index->m_objectStoreBackend->id(), index->id(), keyRange.get(), IDBCursor::NEXT);
    197198
    198199    if (!backingStoreCursor) {
     
    201202    }
    202203
    203     RefPtr<IDBKey> keyResult = index->backingStore()->getPrimaryKeyViaIndex(index->databaseId(), index->m_objectStoreBackend->id(), index->id(), *backingStoreCursor->key());
     204    RefPtr<IDBKey> keyResult = index->backingStore()->getPrimaryKeyViaIndex(transaction->backingStoreTransaction(), index->databaseId(), index->m_objectStoreBackend->id(), index->id(), *backingStoreCursor->key());
    204205    if (!keyResult) {
    205206        callbacks->onSuccess(static_cast<IDBKey*>(0));
     
    212213
    213214
    214 void IDBIndexBackendImpl::get(PassRefPtr<IDBKeyRange> prpKeyRange, PassRefPtr<IDBCallbacks> prpCallbacks, IDBTransactionBackendInterface* transaction, ExceptionCode& ec)
     215void IDBIndexBackendImpl::get(PassRefPtr<IDBKeyRange> prpKeyRange, PassRefPtr<IDBCallbacks> prpCallbacks, IDBTransactionBackendInterface* transactionPtr, ExceptionCode& ec)
    215216{
    216217    IDB_TRACE("IDBIndexBackendImpl::get");
     
    218219    RefPtr<IDBKeyRange> keyRange = prpKeyRange;
    219220    RefPtr<IDBCallbacks> callbacks = prpCallbacks;
    220     if (!IDBTransactionBackendImpl::from(transaction)->scheduleTask(
    221             createCallbackTask(&getInternal, index, keyRange, callbacks)))
    222         ec = IDBDatabaseException::TRANSACTION_INACTIVE_ERR;
    223 }
    224 
    225 void IDBIndexBackendImpl::getKey(PassRefPtr<IDBKeyRange> prpKeyRange, PassRefPtr<IDBCallbacks> prpCallbacks, IDBTransactionBackendInterface* transaction, ExceptionCode& ec)
     221    RefPtr<IDBTransactionBackendImpl> transaction = IDBTransactionBackendImpl::from(transactionPtr);
     222    if (!transaction->scheduleTask(createCallbackTask(&getInternal, index, keyRange, callbacks, transaction)))
     223        ec = IDBDatabaseException::TRANSACTION_INACTIVE_ERR;
     224}
     225
     226void IDBIndexBackendImpl::getKey(PassRefPtr<IDBKeyRange> prpKeyRange, PassRefPtr<IDBCallbacks> prpCallbacks, IDBTransactionBackendInterface* transactionPtr, ExceptionCode& ec)
    226227{
    227228    IDB_TRACE("IDBIndexBackendImpl::getKey");
     
    229230    RefPtr<IDBKeyRange> keyRange = prpKeyRange;
    230231    RefPtr<IDBCallbacks> callbacks = prpCallbacks;
    231     if (!IDBTransactionBackendImpl::from(transaction)->scheduleTask(
    232             createCallbackTask(&getKeyInternal, index, keyRange, callbacks)))
     232    RefPtr<IDBTransactionBackendImpl> transaction = IDBTransactionBackendImpl::from(transactionPtr);
     233    if (!transaction->scheduleTask(
     234            createCallbackTask(&getKeyInternal, index, keyRange, callbacks, transaction)))
    233235        ec = IDBDatabaseException::TRANSACTION_INACTIVE_ERR;
    234236}
  • trunk/Source/WebCore/Modules/indexeddb/IDBIndexBackendImpl.h

    r123276 r129066  
    8080
    8181    static void openCursorInternal(ScriptExecutionContext*, PassRefPtr<IDBIndexBackendImpl>, PassRefPtr<IDBKeyRange>, unsigned short direction, IDBCursorBackendInterface::CursorType, PassRefPtr<IDBCallbacks>, PassRefPtr<IDBTransactionBackendImpl>);
    82     static void countInternal(ScriptExecutionContext*, PassRefPtr<IDBIndexBackendImpl>, PassRefPtr<IDBKeyRange>, PassRefPtr<IDBCallbacks>);
    83     static void getInternal(ScriptExecutionContext*, PassRefPtr<IDBIndexBackendImpl>, PassRefPtr<IDBKeyRange>, PassRefPtr<IDBCallbacks>);
    84     static void getKeyInternal(ScriptExecutionContext*, PassRefPtr<IDBIndexBackendImpl>, PassRefPtr<IDBKeyRange>, PassRefPtr<IDBCallbacks>);
     82    static void countInternal(ScriptExecutionContext*, PassRefPtr<IDBIndexBackendImpl>, PassRefPtr<IDBKeyRange>, PassRefPtr<IDBCallbacks>, PassRefPtr<IDBTransactionBackendImpl>);
     83    static void getInternal(ScriptExecutionContext*, PassRefPtr<IDBIndexBackendImpl>, PassRefPtr<IDBKeyRange>, PassRefPtr<IDBCallbacks>, PassRefPtr<IDBTransactionBackendImpl>);
     84    static void getKeyInternal(ScriptExecutionContext*, PassRefPtr<IDBIndexBackendImpl>, PassRefPtr<IDBKeyRange>, PassRefPtr<IDBCallbacks>, PassRefPtr<IDBTransactionBackendImpl>);
    8585
    8686    static const int64_t InvalidId = 0;
  • trunk/Source/WebCore/Modules/indexeddb/IDBLevelDBBackingStore.cpp

    r129037 r129066  
    337337}
    338338
    339 bool IDBLevelDBBackingStore::updateIDBDatabaseIntVersion(int64_t rowId, int64_t intVersion)
    340 {
    341     ASSERT(m_currentTransaction);
     339bool IDBLevelDBBackingStore::updateIDBDatabaseIntVersion(IDBBackingStore::Transaction* transaction, int64_t rowId, int64_t intVersion)
     340{
    342341    if (intVersion == IDBDatabaseMetadata::NoIntVersion)
    343342        intVersion = IDBDatabaseMetadata::DefaultIntVersion;
    344343    ASSERT_WITH_MESSAGE(intVersion >= 0, "intVersion was %lld", static_cast<long long>(intVersion));
    345     if (!putVarInt(m_currentTransaction.get(), DatabaseMetaDataKey::encode(rowId, DatabaseMetaDataKey::UserIntVersion), intVersion))
    346         return false;
    347 
    348     return true;
    349 }
    350 
    351 bool IDBLevelDBBackingStore::updateIDBDatabaseMetaData(int64_t rowId, const String& version)
    352 {
    353     ASSERT(m_currentTransaction);
    354     if (!putString(m_currentTransaction.get(), DatabaseMetaDataKey::encode(rowId, DatabaseMetaDataKey::UserVersion), version))
     344    if (!putVarInt(Transaction::levelDBTransactionFrom(transaction), DatabaseMetaDataKey::encode(rowId, DatabaseMetaDataKey::UserIntVersion), intVersion))
     345        return false;
     346
     347    return true;
     348}
     349
     350bool IDBLevelDBBackingStore::updateIDBDatabaseMetaData(IDBBackingStore::Transaction* transaction, int64_t rowId, const String& version)
     351{
     352    if (!putString(Transaction::levelDBTransactionFrom(transaction), DatabaseMetaDataKey::encode(rowId, DatabaseMetaDataKey::UserVersion), version))
    355353        return false;
    356354
     
    520518}
    521519
    522 bool IDBLevelDBBackingStore::createObjectStore(int64_t databaseId, const String& name, const IDBKeyPath& keyPath, bool autoIncrement, int64_t& assignedObjectStoreId)
     520bool IDBLevelDBBackingStore::createObjectStore(IDBBackingStore::Transaction* transaction, int64_t databaseId, const String& name, const IDBKeyPath& keyPath, bool autoIncrement, int64_t& assignedObjectStoreId)
    523521{
    524522    IDB_TRACE("IDBLevelDBBackingStore::createObjectStore");
    525     ASSERT(m_currentTransaction);
    526     int64_t objectStoreId = getNewObjectStoreId(m_currentTransaction.get(), databaseId);
     523    LevelDBTransaction* levelDBTransaction = Transaction::levelDBTransactionFrom(transaction);
     524    int64_t objectStoreId = getNewObjectStoreId(levelDBTransaction, databaseId);
    527525    if (objectStoreId < 0)
    528526        return false;
     
    538536    const Vector<char> namesKey = ObjectStoreNamesKey::encode(databaseId, name);
    539537
    540     bool ok = putString(m_currentTransaction.get(), nameKey, name);
     538    bool ok = putString(levelDBTransaction, nameKey, name);
    541539    if (!ok) {
    542540        LOG_ERROR("Internal Indexed DB error.");
     
    544542    }
    545543
    546     ok = putIDBKeyPath(m_currentTransaction.get(), keyPathKey, keyPath);
     544    ok = putIDBKeyPath(levelDBTransaction, keyPathKey, keyPath);
    547545    if (!ok) {
    548546        LOG_ERROR("Internal Indexed DB error.");
     
    550548    }
    551549
    552     ok = putInt(m_currentTransaction.get(), autoIncrementKey, autoIncrement);
     550    ok = putInt(levelDBTransaction, autoIncrementKey, autoIncrement);
    553551    if (!ok) {
    554552        LOG_ERROR("Internal Indexed DB error.");
     
    556554    }
    557555
    558     ok = putInt(m_currentTransaction.get(), evictableKey, false);
     556    ok = putInt(levelDBTransaction, evictableKey, false);
    559557    if (!ok) {
    560558        LOG_ERROR("Internal Indexed DB error.");
     
    562560    }
    563561
    564     ok = putInt(m_currentTransaction.get(), lastVersionKey, 1);
     562    ok = putInt(levelDBTransaction, lastVersionKey, 1);
    565563    if (!ok) {
    566564        LOG_ERROR("Internal Indexed DB error.");
     
    568566    }
    569567
    570     ok = putInt(m_currentTransaction.get(), maxIndexIdKey, MinimumIndexId);
     568    ok = putInt(levelDBTransaction, maxIndexIdKey, MinimumIndexId);
    571569    if (!ok) {
    572570        LOG_ERROR("Internal Indexed DB error.");
     
    574572    }
    575573
    576     ok = putBool(m_currentTransaction.get(), hasKeyPathKey, !keyPath.isNull());
     574    ok = putBool(levelDBTransaction, hasKeyPathKey, !keyPath.isNull());
    577575    if (!ok) {
    578576        LOG_ERROR("Internal Indexed DB error.");
     
    580578    }
    581579
    582     ok = putInt(m_currentTransaction.get(), keyGeneratorCurrentNumberKey, KeyGeneratorInitialNumber);
     580    ok = putInt(levelDBTransaction, keyGeneratorCurrentNumberKey, KeyGeneratorInitialNumber);
    583581    if (!ok) {
    584582        LOG_ERROR("Internal Indexed DB error.");
     
    586584    }
    587585
    588     ok = putInt(m_currentTransaction.get(), namesKey, objectStoreId);
     586    ok = putInt(levelDBTransaction, namesKey, objectStoreId);
    589587    if (!ok) {
    590588        LOG_ERROR("Internal Indexed DB error.");
     
    597595}
    598596
    599 void IDBLevelDBBackingStore::deleteObjectStore(int64_t databaseId, int64_t objectStoreId)
     597void IDBLevelDBBackingStore::deleteObjectStore(IDBBackingStore::Transaction* transaction, int64_t databaseId, int64_t objectStoreId)
    600598{
    601599    IDB_TRACE("IDBLevelDBBackingStore::deleteObjectStore");
    602     ASSERT(m_currentTransaction);
     600    LevelDBTransaction* levelDBTransaction = Transaction::levelDBTransactionFrom(transaction);
    603601
    604602    String objectStoreName;
    605     getString(m_currentTransaction.get(), ObjectStoreMetaDataKey::encode(databaseId, objectStoreId, ObjectStoreMetaDataKey::Name), objectStoreName);
    606 
    607     if (!deleteRange(m_currentTransaction.get(), ObjectStoreMetaDataKey::encode(databaseId, objectStoreId, 0), ObjectStoreMetaDataKey::encodeMaxKey(databaseId, objectStoreId)))
     603    getString(levelDBTransaction, ObjectStoreMetaDataKey::encode(databaseId, objectStoreId, ObjectStoreMetaDataKey::Name), objectStoreName);
     604
     605    if (!deleteRange(levelDBTransaction, ObjectStoreMetaDataKey::encode(databaseId, objectStoreId, 0), ObjectStoreMetaDataKey::encodeMaxKey(databaseId, objectStoreId)))
    608606        return; // FIXME: Report error.
    609607
    610     m_currentTransaction->remove(ObjectStoreNamesKey::encode(databaseId, objectStoreName));
    611 
    612     if (!deleteRange(m_currentTransaction.get(), IndexFreeListKey::encode(databaseId, objectStoreId, 0), IndexFreeListKey::encodeMaxKey(databaseId, objectStoreId)))
     608    levelDBTransaction->remove(ObjectStoreNamesKey::encode(databaseId, objectStoreName));
     609
     610    if (!deleteRange(levelDBTransaction, IndexFreeListKey::encode(databaseId, objectStoreId, 0), IndexFreeListKey::encodeMaxKey(databaseId, objectStoreId)))
    613611        return; // FIXME: Report error.
    614     if (!deleteRange(m_currentTransaction.get(), IndexMetaDataKey::encode(databaseId, objectStoreId, 0, 0), IndexMetaDataKey::encodeMaxKey(databaseId, objectStoreId)))
     612    if (!deleteRange(levelDBTransaction, IndexMetaDataKey::encode(databaseId, objectStoreId, 0, 0), IndexMetaDataKey::encodeMaxKey(databaseId, objectStoreId)))
    615613        return; // FIXME: Report error.
    616614
    617     clearObjectStore(databaseId, objectStoreId);
    618 }
    619 
    620 String IDBLevelDBBackingStore::getObjectStoreRecord(int64_t databaseId, int64_t objectStoreId, const IDBKey& key)
     615    clearObjectStore(transaction, databaseId, objectStoreId);
     616}
     617
     618String IDBLevelDBBackingStore::getObjectStoreRecord(IDBBackingStore::Transaction* transaction, int64_t databaseId, int64_t objectStoreId, const IDBKey& key)
    621619{
    622620    IDB_TRACE("IDBLevelDBBackingStore::getObjectStoreRecord");
     621    LevelDBTransaction* levelDBTransaction = Transaction::levelDBTransactionFrom(transaction);
     622
    623623    const Vector<char> leveldbKey = ObjectStoreDataKey::encode(databaseId, objectStoreId, key);
    624624    Vector<char> data;
    625625
    626     ASSERT(m_currentTransaction);
    627     if (!m_currentTransaction->get(leveldbKey, data))
     626    if (!levelDBTransaction->get(leveldbKey, data))
    628627        return String();
    629628
     
    677676}
    678677
    679 bool IDBLevelDBBackingStore::putObjectStoreRecord(int64_t databaseId, int64_t objectStoreId, const IDBKey& key, const String& value, ObjectStoreRecordIdentifier* recordIdentifier)
     678bool IDBLevelDBBackingStore::putObjectStoreRecord(IDBBackingStore::Transaction* transaction, int64_t databaseId, int64_t objectStoreId, const IDBKey& key, const String& value, ObjectStoreRecordIdentifier* recordIdentifier)
    680679{
    681680    IDB_TRACE("IDBLevelDBBackingStore::putObjectStoreRecord");
    682681    ASSERT(key.isValid());
    683     ASSERT(m_currentTransaction);
    684     int64_t version = getNewVersionNumber(m_currentTransaction.get(), databaseId, objectStoreId);
     682    LevelDBTransaction* levelDBTransaction = Transaction::levelDBTransactionFrom(transaction);
     683    int64_t version = getNewVersionNumber(levelDBTransaction, databaseId, objectStoreId);
    685684    const Vector<char> objectStoredataKey = ObjectStoreDataKey::encode(databaseId, objectStoreId, key);
    686685
     
    689688    v.append(encodeString(value));
    690689
    691     if (!m_currentTransaction->put(objectStoredataKey, v))
     690    if (!levelDBTransaction->put(objectStoredataKey, v))
    692691        return false;
    693692
    694693    const Vector<char> existsEntryKey = ExistsEntryKey::encode(databaseId, objectStoreId, key);
    695     if (!m_currentTransaction->put(existsEntryKey, encodeInt(version)))
     694    if (!levelDBTransaction->put(existsEntryKey, encodeInt(version)))
    696695        return false;
    697696
     
    702701}
    703702
    704 void IDBLevelDBBackingStore::clearObjectStore(int64_t databaseId, int64_t objectStoreId)
     703void IDBLevelDBBackingStore::clearObjectStore(IDBBackingStore::Transaction* transaction, int64_t databaseId, int64_t objectStoreId)
    705704{
    706705    IDB_TRACE("IDBLevelDBBackingStore::clearObjectStore");
    707     ASSERT(m_currentTransaction);
     706    LevelDBTransaction* levelDBTransaction = Transaction::levelDBTransactionFrom(transaction);
    708707    const Vector<char> startKey = KeyPrefix(databaseId, objectStoreId, 0).encode();
    709708    const Vector<char> stopKey = KeyPrefix(databaseId, objectStoreId + 1, 0).encode();
    710709
    711     deleteRange(m_currentTransaction.get(), startKey, stopKey);
     710    deleteRange(levelDBTransaction, startKey, stopKey);
    712711}
    713712
     
    717716}
    718717
    719 void IDBLevelDBBackingStore::deleteObjectStoreRecord(int64_t databaseId, int64_t objectStoreId, const ObjectStoreRecordIdentifier* recordIdentifier)
     718void IDBLevelDBBackingStore::deleteObjectStoreRecord(IDBBackingStore::Transaction* transaction, int64_t databaseId, int64_t objectStoreId, const ObjectStoreRecordIdentifier* recordIdentifier)
    720719{
    721720    IDB_TRACE("IDBLevelDBBackingStore::deleteObjectStoreRecord");
    722     ASSERT(m_currentTransaction);
     721    LevelDBTransaction* levelDBTransaction = Transaction::levelDBTransactionFrom(transaction);
    723722    const LevelDBRecordIdentifier* levelDBRecordIdentifier = static_cast<const LevelDBRecordIdentifier*>(recordIdentifier);
    724723
    725724    const Vector<char> objectStoreDataKey = ObjectStoreDataKey::encode(databaseId, objectStoreId, levelDBRecordIdentifier->primaryKey());
    726     m_currentTransaction->remove(objectStoreDataKey);
     725    levelDBTransaction->remove(objectStoreDataKey);
    727726
    728727    const Vector<char> existsEntryKey = ExistsEntryKey::encode(databaseId, objectStoreId, levelDBRecordIdentifier->primaryKey());
    729     m_currentTransaction->remove(existsEntryKey);
    730 }
    731 
    732 
    733 int64_t IDBLevelDBBackingStore::getKeyGeneratorCurrentNumber(int64_t databaseId, int64_t objectStoreId)
    734 {
    735     ASSERT(m_currentTransaction);
     728    levelDBTransaction->remove(existsEntryKey);
     729}
     730
     731
     732int64_t IDBLevelDBBackingStore::getKeyGeneratorCurrentNumber(IDBBackingStore::Transaction* transaction, int64_t databaseId, int64_t objectStoreId)
     733{
     734    LevelDBTransaction* levelDBTransaction = Transaction::levelDBTransactionFrom(transaction);
    736735
    737736    const Vector<char> keyGeneratorCurrentNumberKey = ObjectStoreMetaDataKey::encode(databaseId, objectStoreId, ObjectStoreMetaDataKey::KeyGeneratorCurrentNumber);
     
    740739    Vector<char> data;
    741740
    742     if (m_currentTransaction->get(keyGeneratorCurrentNumberKey, data))
     741    if (levelDBTransaction->get(keyGeneratorCurrentNumberKey, data))
    743742        keyGeneratorCurrentNumber = decodeInt(data.begin(), data.end());
    744743    else {
     
    749748        const Vector<char> stopKey = ObjectStoreDataKey::encode(databaseId, objectStoreId, maxIDBKey());
    750749
    751         OwnPtr<LevelDBIterator> it = m_currentTransaction->createIterator();
     750        OwnPtr<LevelDBIterator> it = levelDBTransaction->createIterator();
    752751        int64_t maxNumericKey = 0;
    753752
     
    773772}
    774773
    775 bool IDBLevelDBBackingStore::maybeUpdateKeyGeneratorCurrentNumber(int64_t databaseId, int64_t objectStoreId, int64_t newNumber, bool checkCurrent)
    776 {
    777     ASSERT(m_currentTransaction);
     774bool IDBLevelDBBackingStore::maybeUpdateKeyGeneratorCurrentNumber(IDBBackingStore::Transaction* transaction, int64_t databaseId, int64_t objectStoreId, int64_t newNumber, bool checkCurrent)
     775{
     776    LevelDBTransaction* levelDBTransaction = Transaction::levelDBTransactionFrom(transaction);
    778777
    779778    if (checkCurrent) {
    780         int64_t currentNumber = getKeyGeneratorCurrentNumber(databaseId, objectStoreId);
     779        int64_t currentNumber = getKeyGeneratorCurrentNumber(transaction, databaseId, objectStoreId);
    781780        if (newNumber <= currentNumber)
    782781            return true;
     
    784783
    785784    const Vector<char> keyGeneratorCurrentNumberKey = ObjectStoreMetaDataKey::encode(databaseId, objectStoreId, ObjectStoreMetaDataKey::KeyGeneratorCurrentNumber);
    786     bool ok = putInt(m_currentTransaction.get(), keyGeneratorCurrentNumberKey, newNumber);
     785    bool ok = putInt(levelDBTransaction, keyGeneratorCurrentNumberKey, newNumber);
    787786    if (!ok) {
    788787        LOG_ERROR("Internal Indexed DB error.");
     
    792791}
    793792
    794 bool IDBLevelDBBackingStore::keyExistsInObjectStore(int64_t databaseId, int64_t objectStoreId, const IDBKey& key, ObjectStoreRecordIdentifier* foundRecordIdentifier)
     793bool IDBLevelDBBackingStore::keyExistsInObjectStore(IDBBackingStore::Transaction* transaction, int64_t databaseId, int64_t objectStoreId, const IDBKey& key, ObjectStoreRecordIdentifier* foundRecordIdentifier)
    795794{
    796795    IDB_TRACE("IDBLevelDBBackingStore::keyExistsInObjectStore");
    797     ASSERT(m_currentTransaction);
     796    LevelDBTransaction* levelDBTransaction = Transaction::levelDBTransactionFrom(transaction);
    798797    const Vector<char> leveldbKey = ObjectStoreDataKey::encode(databaseId, objectStoreId, key);
    799798    Vector<char> data;
    800799
    801     if (!m_currentTransaction->get(leveldbKey, data))
     800    if (!levelDBTransaction->get(leveldbKey, data))
    802801        return false;
    803802
     
    812811}
    813812
    814 bool IDBLevelDBBackingStore::forEachObjectStoreRecord(int64_t databaseId, int64_t objectStoreId, ObjectStoreRecordCallback& callback)
    815 {
    816     ASSERT(m_currentTransaction);
     813bool IDBLevelDBBackingStore::forEachObjectStoreRecord(IDBBackingStore::Transaction* transaction, int64_t databaseId, int64_t objectStoreId, ObjectStoreRecordCallback& callback)
     814{
     815    LevelDBTransaction* levelDBTransaction = Transaction::levelDBTransactionFrom(transaction);
    817816    const Vector<char> startKey = ObjectStoreDataKey::encode(databaseId, objectStoreId, minIDBKey());
    818817    const Vector<char> stopKey = ObjectStoreDataKey::encode(databaseId, objectStoreId, maxIDBKey());
    819818
    820     OwnPtr<LevelDBIterator> it = m_currentTransaction->createIterator();
     819    OwnPtr<LevelDBIterator> it = levelDBTransaction->createIterator();
    821820    for (it->seek(startKey); it->isValid() && compareKeys(it->key(), stopKey) < 0; it->next()) {
    822821        const char* p = it->key().begin();
     
    936935}
    937936
    938 bool IDBLevelDBBackingStore::createIndex(int64_t databaseId, int64_t objectStoreId, const String& name, const IDBKeyPath& keyPath, bool isUnique, bool isMultiEntry, int64_t& indexId)
     937bool IDBLevelDBBackingStore::createIndex(IDBBackingStore::Transaction* transaction, int64_t databaseId, int64_t objectStoreId, const String& name, const IDBKeyPath& keyPath, bool isUnique, bool isMultiEntry, int64_t& indexId)
    939938{
    940939    IDB_TRACE("IDBLevelDBBackingStore::createIndex");
    941     ASSERT(m_currentTransaction);
    942     indexId = getNewIndexId(m_currentTransaction.get(), databaseId, objectStoreId);
     940    LevelDBTransaction* levelDBTransaction = Transaction::levelDBTransactionFrom(transaction);
     941    indexId = getNewIndexId(levelDBTransaction, databaseId, objectStoreId);
    943942    if (indexId < 0)
    944943        return false;
     
    949948    const Vector<char> multiEntryKey = IndexMetaDataKey::encode(databaseId, objectStoreId, indexId, IndexMetaDataKey::MultiEntry);
    950949
    951     bool ok = putString(m_currentTransaction.get(), nameKey, name);
     950    bool ok = putString(levelDBTransaction, nameKey, name);
    952951    if (!ok) {
    953952        LOG_ERROR("Internal Indexed DB error.");
     
    955954    }
    956955
    957     ok = putBool(m_currentTransaction.get(), uniqueKey, isUnique);
     956    ok = putBool(levelDBTransaction, uniqueKey, isUnique);
    958957    if (!ok) {
    959958        LOG_ERROR("Internal Indexed DB error.");
     
    961960    }
    962961
    963     ok = putIDBKeyPath(m_currentTransaction.get(), keyPathKey, keyPath);
     962    ok = putIDBKeyPath(levelDBTransaction, keyPathKey, keyPath);
    964963    if (!ok) {
    965964        LOG_ERROR("Internal Indexed DB error.");
     
    967966    }
    968967
    969     ok = putBool(m_currentTransaction.get(), multiEntryKey, isMultiEntry);
     968    ok = putBool(levelDBTransaction, multiEntryKey, isMultiEntry);
    970969    if (!ok) {
    971970        LOG_ERROR("Internal Indexed DB error.");
     
    976975}
    977976
    978 void IDBLevelDBBackingStore::deleteIndex(int64_t databaseId, int64_t objectStoreId, int64_t indexId)
     977void IDBLevelDBBackingStore::deleteIndex(IDBBackingStore::Transaction* transaction, int64_t databaseId, int64_t objectStoreId, int64_t indexId)
    979978{
    980979    IDB_TRACE("IDBLevelDBBackingStore::deleteIndex");
    981     ASSERT(m_currentTransaction);
     980    LevelDBTransaction* levelDBTransaction = Transaction::levelDBTransactionFrom(transaction);
    982981
    983982    const Vector<char> indexMetaDataStart = IndexMetaDataKey::encode(databaseId, objectStoreId, indexId, 0);
    984983    const Vector<char> indexMetaDataEnd = IndexMetaDataKey::encodeMaxKey(databaseId, objectStoreId, indexId);
    985984
    986     if (!deleteRange(m_currentTransaction.get(), indexMetaDataStart, indexMetaDataEnd)) {
     985    if (!deleteRange(levelDBTransaction, indexMetaDataStart, indexMetaDataEnd)) {
    987986        LOG_ERROR("Internal Indexed DB error.");
    988987        return;
     
    992991    const Vector<char> indexDataEnd = IndexDataKey::encodeMaxKey(databaseId, objectStoreId, indexId);
    993992
    994     if (!deleteRange(m_currentTransaction.get(), indexDataStart, indexDataEnd)) {
     993    if (!deleteRange(levelDBTransaction, indexDataStart, indexDataEnd)) {
    995994        LOG_ERROR("Internal Indexed DB error.");
    996995        return;
     
    998997}
    999998
    1000 bool IDBLevelDBBackingStore::putIndexDataForRecord(int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey& key, const ObjectStoreRecordIdentifier* recordIdentifier)
     999bool IDBLevelDBBackingStore::putIndexDataForRecord(IDBBackingStore::Transaction* transaction, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey& key, const ObjectStoreRecordIdentifier* recordIdentifier)
    10011000{
    10021001    IDB_TRACE("IDBLevelDBBackingStore::putIndexDataForRecord");
     
    10051004    const LevelDBRecordIdentifier* levelDBRecordIdentifier = static_cast<const LevelDBRecordIdentifier*>(recordIdentifier);
    10061005
    1007     ASSERT(m_currentTransaction);
     1006    LevelDBTransaction* levelDBTransaction = Transaction::levelDBTransactionFrom(transaction);
    10081007    const Vector<char> indexDataKey = IndexDataKey::encode(databaseId, objectStoreId, indexId, encodeIDBKey(key), levelDBRecordIdentifier->primaryKey());
    10091008
     
    10121011    data.append(levelDBRecordIdentifier->primaryKey());
    10131012
    1014     return m_currentTransaction->put(indexDataKey, data);
     1013    return levelDBTransaction->put(indexDataKey, data);
    10151014}
    10161015
     
    10431042}
    10441043
    1045 bool IDBLevelDBBackingStore::deleteIndexDataForRecord(int64_t, int64_t, int64_t, const ObjectStoreRecordIdentifier*)
     1044bool IDBLevelDBBackingStore::deleteIndexDataForRecord(IDBBackingStore::Transaction*, int64_t, int64_t, int64_t, const ObjectStoreRecordIdentifier*)
    10461045{
    10471046    // FIXME: This isn't needed since we invalidate index data via the version number mechanism.
     
    10601059}
    10611060
    1062 bool IDBLevelDBBackingStore::findKeyInIndex(int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey& key, Vector<char>& foundEncodedPrimaryKey)
     1061bool IDBLevelDBBackingStore::findKeyInIndex(IDBBackingStore::Transaction* transaction, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey& key, Vector<char>& foundEncodedPrimaryKey)
    10631062{
    10641063    IDB_TRACE("IDBLevelDBBackingStore::findKeyInIndex");
    10651064    ASSERT(foundEncodedPrimaryKey.isEmpty());
    10661065
     1066    LevelDBTransaction* levelDBTransaction = Transaction::levelDBTransactionFrom(transaction);
    10671067    const Vector<char> leveldbKey = IndexDataKey::encode(databaseId, objectStoreId, indexId, key);
    1068     OwnPtr<LevelDBIterator> it = m_currentTransaction->createIterator();
     1068    OwnPtr<LevelDBIterator> it = levelDBTransaction->createIterator();
    10691069    it->seek(leveldbKey);
    10701070
     
    10811081        foundEncodedPrimaryKey.append(p, it->value().end() - p);
    10821082
    1083         if (!versionExists(m_currentTransaction.get(), databaseId, objectStoreId, version, foundEncodedPrimaryKey)) {
     1083        if (!versionExists(levelDBTransaction, databaseId, objectStoreId, version, foundEncodedPrimaryKey)) {
    10841084            // Delete stale index data entry and continue.
    1085             m_currentTransaction->remove(it->key());
     1085            levelDBTransaction->remove(it->key());
    10861086            it->next();
    10871087            continue;
     
    10921092}
    10931093
    1094 PassRefPtr<IDBKey> IDBLevelDBBackingStore::getPrimaryKeyViaIndex(int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey& key)
     1094PassRefPtr<IDBKey> IDBLevelDBBackingStore::getPrimaryKeyViaIndex(IDBBackingStore::Transaction* transaction, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey& key)
    10951095{
    10961096    IDB_TRACE("IDBLevelDBBackingStore::getPrimaryKeyViaIndex");
    1097     ASSERT(m_currentTransaction);
    10981097
    10991098    Vector<char> foundEncodedPrimaryKey;
    1100     if (findKeyInIndex(databaseId, objectStoreId, indexId, key, foundEncodedPrimaryKey)) {
     1099    if (findKeyInIndex(transaction, databaseId, objectStoreId, indexId, key, foundEncodedPrimaryKey)) {
    11011100        RefPtr<IDBKey> primaryKey;
    11021101        decodeIDBKey(foundEncodedPrimaryKey.begin(), foundEncodedPrimaryKey.end(), primaryKey);
     
    11071106}
    11081107
    1109 bool IDBLevelDBBackingStore::keyExistsInIndex(int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey& indexKey, RefPtr<IDBKey>& foundPrimaryKey)
     1108bool IDBLevelDBBackingStore::keyExistsInIndex(IDBBackingStore::Transaction* transaction, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey& indexKey, RefPtr<IDBKey>& foundPrimaryKey)
    11101109{
    11111110    IDB_TRACE("IDBLevelDBBackingStore::keyExistsInIndex");
    1112     ASSERT(m_currentTransaction);
    11131111
    11141112    Vector<char> foundEncodedPrimaryKey;
    1115     if (!findKeyInIndex(databaseId, objectStoreId, indexId, indexKey, foundEncodedPrimaryKey))
     1113    if (!findKeyInIndex(transaction, databaseId, objectStoreId, indexId, indexKey, foundEncodedPrimaryKey))
    11161114        return false;
    11171115
     
    16901688}
    16911689
    1692 PassRefPtr<IDBBackingStore::Cursor> IDBLevelDBBackingStore::openObjectStoreCursor(int64_t databaseId, int64_t objectStoreId, const IDBKeyRange* range, IDBCursor::Direction direction)
     1690PassRefPtr<IDBBackingStore::Cursor> IDBLevelDBBackingStore::openObjectStoreCursor(IDBBackingStore::Transaction* transaction, int64_t databaseId, int64_t objectStoreId, const IDBKeyRange* range, IDBCursor::Direction direction)
    16931691{
    16941692    IDB_TRACE("IDBLevelDBBackingStore::openObjectStoreCursor");
    1695     ASSERT(m_currentTransaction);
     1693    LevelDBTransaction* levelDBTransaction = Transaction::levelDBTransactionFrom(transaction);
    16961694    CursorOptions cursorOptions;
    1697     if (!objectStoreCursorOptions(m_currentTransaction.get(), databaseId, objectStoreId, range, direction, cursorOptions))
     1695    if (!objectStoreCursorOptions(levelDBTransaction, databaseId, objectStoreId, range, direction, cursorOptions))
    16981696        return 0;
    1699     RefPtr<ObjectStoreCursorImpl> cursor = ObjectStoreCursorImpl::create(m_currentTransaction.get(), cursorOptions);
     1697    RefPtr<ObjectStoreCursorImpl> cursor = ObjectStoreCursorImpl::create(levelDBTransaction, cursorOptions);
    17001698    if (!cursor->firstSeek())
    17011699        return 0;
     
    17041702}
    17051703
    1706 PassRefPtr<IDBBackingStore::Cursor> IDBLevelDBBackingStore::openObjectStoreKeyCursor(int64_t databaseId, int64_t objectStoreId, const IDBKeyRange* range, IDBCursor::Direction direction)
     1704PassRefPtr<IDBBackingStore::Cursor> IDBLevelDBBackingStore::openObjectStoreKeyCursor(IDBBackingStore::Transaction* transaction, int64_t databaseId, int64_t objectStoreId, const IDBKeyRange* range, IDBCursor::Direction direction)
    17071705{
    17081706    IDB_TRACE("IDBLevelDBBackingStore::openObjectStoreKeyCursor");
    1709     ASSERT(m_currentTransaction);
     1707    LevelDBTransaction* levelDBTransaction = Transaction::levelDBTransactionFrom(transaction);
    17101708    CursorOptions cursorOptions;
    1711     if (!objectStoreCursorOptions(m_currentTransaction.get(), databaseId, objectStoreId, range, direction, cursorOptions))
     1709    if (!objectStoreCursorOptions(levelDBTransaction, databaseId, objectStoreId, range, direction, cursorOptions))
    17121710        return 0;
    1713     RefPtr<ObjectStoreKeyCursorImpl> cursor = ObjectStoreKeyCursorImpl::create(m_currentTransaction.get(), cursorOptions);
     1711    RefPtr<ObjectStoreKeyCursorImpl> cursor = ObjectStoreKeyCursorImpl::create(levelDBTransaction, cursorOptions);
    17141712    if (!cursor->firstSeek())
    17151713        return 0;
     
    17181716}
    17191717
    1720 PassRefPtr<IDBBackingStore::Cursor> IDBLevelDBBackingStore::openIndexKeyCursor(int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKeyRange* range, IDBCursor::Direction direction)
     1718PassRefPtr<IDBBackingStore::Cursor> IDBLevelDBBackingStore::openIndexKeyCursor(IDBBackingStore::Transaction* transaction, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKeyRange* range, IDBCursor::Direction direction)
    17211719{
    17221720    IDB_TRACE("IDBLevelDBBackingStore::openIndexKeyCursor");
    1723     ASSERT(m_currentTransaction);
     1721    LevelDBTransaction* levelDBTransaction = Transaction::levelDBTransactionFrom(transaction);
    17241722    CursorOptions cursorOptions;
    1725     if (!indexCursorOptions(m_currentTransaction.get(), databaseId, objectStoreId, indexId, range, direction, cursorOptions))
     1723    if (!indexCursorOptions(levelDBTransaction, databaseId, objectStoreId, indexId, range, direction, cursorOptions))
    17261724        return 0;
    1727     RefPtr<IndexKeyCursorImpl> cursor = IndexKeyCursorImpl::create(m_currentTransaction.get(), cursorOptions);
     1725    RefPtr<IndexKeyCursorImpl> cursor = IndexKeyCursorImpl::create(levelDBTransaction, cursorOptions);
    17281726    if (!cursor->firstSeek())
    17291727        return 0;
     
    17321730}
    17331731
    1734 PassRefPtr<IDBBackingStore::Cursor> IDBLevelDBBackingStore::openIndexCursor(int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKeyRange* range, IDBCursor::Direction direction)
     1732PassRefPtr<IDBBackingStore::Cursor> IDBLevelDBBackingStore::openIndexCursor(IDBBackingStore::Transaction* transaction, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKeyRange* range, IDBCursor::Direction direction)
    17351733{
    17361734    IDB_TRACE("IDBLevelDBBackingStore::openIndexCursor");
    1737     ASSERT(m_currentTransaction);
     1735    LevelDBTransaction* levelDBTransaction = Transaction::levelDBTransactionFrom(transaction);
    17381736    CursorOptions cursorOptions;
    1739     if (!indexCursorOptions(m_currentTransaction.get(), databaseId, objectStoreId, indexId, range, direction, cursorOptions))
     1737    if (!indexCursorOptions(levelDBTransaction, databaseId, objectStoreId, indexId, range, direction, cursorOptions))
    17401738        return 0;
    1741     RefPtr<IndexCursorImpl> cursor = IndexCursorImpl::create(m_currentTransaction.get(), cursorOptions);
     1739    RefPtr<IndexCursorImpl> cursor = IndexCursorImpl::create(levelDBTransaction, cursorOptions);
    17421740    if (!cursor->firstSeek())
    17431741        return 0;
     
    17631761void IDBLevelDBBackingStore::Transaction::begin()
    17641762{
    1765     ASSERT(!m_backingStore->m_currentTransaction);
    1766     m_backingStore->m_currentTransaction = LevelDBTransaction::create(m_backingStore->m_db.get());
     1763    IDB_TRACE("IDBLevelDBBackingStore::Transaction::begin");
     1764    ASSERT(!m_transaction);
     1765    m_transaction = LevelDBTransaction::create(m_backingStore->m_db.get());
    17671766}
    17681767
     
    17701769{
    17711770    IDB_TRACE("IDBLevelDBBackingStore::Transaction::commit");
    1772     ASSERT(m_backingStore->m_currentTransaction);
    1773     bool result = m_backingStore->m_currentTransaction->commit();
    1774     m_backingStore->m_currentTransaction.clear();
     1771    ASSERT(m_transaction);
     1772    bool result = m_transaction->commit();
     1773    m_transaction.clear();
    17751774    return result;
    17761775}
     
    17791778{
    17801779    IDB_TRACE("IDBLevelDBBackingStore::Transaction::rollback");
    1781     ASSERT(m_backingStore->m_currentTransaction);
    1782     m_backingStore->m_currentTransaction->rollback();
    1783     m_backingStore->m_currentTransaction.clear();
     1780    ASSERT(m_transaction);
     1781    m_transaction->rollback();
     1782    m_transaction.clear();
    17841783}
    17851784
  • trunk/Source/WebCore/Modules/indexeddb/IDBLevelDBBackingStore.h

    r128217 r129066  
    4848    virtual bool getIDBDatabaseMetaData(const String& name, String& foundVersion, int64_t& foundIntVersion, int64_t& foundId);
    4949    virtual bool createIDBDatabaseMetaData(const String& name, const String& version, int64_t intVersion, int64_t& rowId);
    50     virtual bool updateIDBDatabaseMetaData(int64_t rowId, const String& version);
    51     virtual bool updateIDBDatabaseIntVersion(int64_t rowId, int64_t intVersion);
     50    virtual bool updateIDBDatabaseMetaData(IDBBackingStore::Transaction*, int64_t rowId, const String& version);
     51    virtual bool updateIDBDatabaseIntVersion(IDBBackingStore::Transaction*, int64_t rowId, int64_t intVersion);
    5252    virtual bool deleteDatabase(const String& name);
    5353
    5454    virtual void getObjectStores(int64_t databaseId, Vector<int64_t>& foundIds, Vector<String>& foundNames, Vector<IDBKeyPath>& foundKeyPaths, Vector<bool>& foundAutoIncrementFlags);
    55     virtual bool createObjectStore(int64_t databaseId, const String& name, const IDBKeyPath&, bool autoIncrement, int64_t& assignedObjectStoreId);
    56     virtual void deleteObjectStore(int64_t databaseId, int64_t objectStoreId);
     55    virtual bool createObjectStore(IDBBackingStore::Transaction*, int64_t databaseId, const String& name, const IDBKeyPath&, bool autoIncrement, int64_t& assignedObjectStoreId);
     56    virtual void deleteObjectStore(IDBBackingStore::Transaction*, int64_t databaseId, int64_t objectStoreId);
    5757    virtual PassRefPtr<ObjectStoreRecordIdentifier> createInvalidRecordIdentifier();
    58     virtual String getObjectStoreRecord(int64_t databaseId, int64_t objectStoreId, const IDBKey&);
    59     virtual bool putObjectStoreRecord(int64_t databaseId, int64_t objectStoreId, const IDBKey&, const String& value, ObjectStoreRecordIdentifier*);
    60     virtual void clearObjectStore(int64_t databaseId, int64_t objectStoreId);
    61     virtual void deleteObjectStoreRecord(int64_t databaseId, int64_t objectStoreId, const ObjectStoreRecordIdentifier*);
    62     virtual int64_t getKeyGeneratorCurrentNumber(int64_t databaseId, int64_t objectStoreId);
    63     virtual bool maybeUpdateKeyGeneratorCurrentNumber(int64_t databaseId, int64_t objectStoreId, int64_t newState, bool checkCurrent);
    64     virtual bool keyExistsInObjectStore(int64_t databaseId, int64_t objectStoreId, const IDBKey&, ObjectStoreRecordIdentifier* foundRecordIdentifier);
     58    virtual String getObjectStoreRecord(IDBBackingStore::Transaction*, int64_t databaseId, int64_t objectStoreId, const IDBKey&);
     59    virtual bool putObjectStoreRecord(IDBBackingStore::Transaction*, int64_t databaseId, int64_t objectStoreId, const IDBKey&, const String& value, ObjectStoreRecordIdentifier*);
     60    virtual void clearObjectStore(IDBBackingStore::Transaction*, int64_t databaseId, int64_t objectStoreId);
     61    virtual void deleteObjectStoreRecord(IDBBackingStore::Transaction*, int64_t databaseId, int64_t objectStoreId, const ObjectStoreRecordIdentifier*);
     62    virtual int64_t getKeyGeneratorCurrentNumber(IDBBackingStore::Transaction*, int64_t databaseId, int64_t objectStoreId);
     63    virtual bool maybeUpdateKeyGeneratorCurrentNumber(IDBBackingStore::Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t newState, bool checkCurrent);
     64    virtual bool keyExistsInObjectStore(IDBBackingStore::Transaction*, int64_t databaseId, int64_t objectStoreId, const IDBKey&, ObjectStoreRecordIdentifier* foundRecordIdentifier);
    6565
    66     virtual bool forEachObjectStoreRecord(int64_t databaseId, int64_t objectStoreId, ObjectStoreRecordCallback&);
     66    virtual bool forEachObjectStoreRecord(IDBBackingStore::Transaction*, int64_t databaseId, int64_t objectStoreId, ObjectStoreRecordCallback&);
    6767
    6868    virtual void getIndexes(int64_t databaseId, int64_t objectStoreId, Vector<int64_t>& foundIds, Vector<String>& foundNames, Vector<IDBKeyPath>& foundKeyPaths, Vector<bool>& foundUniqueFlags, Vector<bool>& foundMultiEntryFlags);
    69     virtual bool createIndex(int64_t databaseId, int64_t objectStoreId, const String& name, const IDBKeyPath&, bool isUnique, bool isMultiEntry, int64_t& indexId);
    70     virtual void deleteIndex(int64_t databaseId, int64_t objectStoreId, int64_t indexId);
    71     virtual bool putIndexDataForRecord(int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey&, const ObjectStoreRecordIdentifier*);
    72     virtual bool deleteIndexDataForRecord(int64_t databaseId, int64_t objectStoreId, int64_t indexId, const ObjectStoreRecordIdentifier*);
    73     virtual PassRefPtr<IDBKey> getPrimaryKeyViaIndex(int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey&);
    74     virtual bool keyExistsInIndex(int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey& indexKey, RefPtr<IDBKey>& foundPrimaryKey);
     69    virtual bool createIndex(IDBBackingStore::Transaction*, int64_t databaseId, int64_t objectStoreId, const String& name, const IDBKeyPath&, bool isUnique, bool isMultiEntry, int64_t& indexId);
     70    virtual void deleteIndex(IDBBackingStore::Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId);
     71    virtual bool putIndexDataForRecord(IDBBackingStore::Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey&, const ObjectStoreRecordIdentifier*);
     72    virtual bool deleteIndexDataForRecord(IDBBackingStore::Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const ObjectStoreRecordIdentifier*);
     73    virtual PassRefPtr<IDBKey> getPrimaryKeyViaIndex(IDBBackingStore::Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey&);
     74    virtual bool keyExistsInIndex(IDBBackingStore::Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey& indexKey, RefPtr<IDBKey>& foundPrimaryKey);
    7575
    76     virtual PassRefPtr<Cursor> openObjectStoreKeyCursor(int64_t databaseId, int64_t objectStoreId, const IDBKeyRange*, IDBCursor::Direction);
    77     virtual PassRefPtr<Cursor> openObjectStoreCursor(int64_t databaseId, int64_t objectStoreId, const IDBKeyRange*, IDBCursor::Direction);
    78     virtual PassRefPtr<Cursor> openIndexKeyCursor(int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKeyRange*, IDBCursor::Direction);
    79     virtual PassRefPtr<Cursor> openIndexCursor(int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKeyRange*, IDBCursor::Direction);
     76    virtual PassRefPtr<Cursor> openObjectStoreKeyCursor(IDBBackingStore::Transaction*, int64_t databaseId, int64_t objectStoreId, const IDBKeyRange*, IDBCursor::Direction);
     77    virtual PassRefPtr<Cursor> openObjectStoreCursor(IDBBackingStore::Transaction*, int64_t databaseId, int64_t objectStoreId, const IDBKeyRange*, IDBCursor::Direction);
     78    virtual PassRefPtr<Cursor> openIndexKeyCursor(IDBBackingStore::Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKeyRange*, IDBCursor::Direction);
     79    virtual PassRefPtr<Cursor> openIndexCursor(IDBBackingStore::Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKeyRange*, IDBCursor::Direction);
    8080
    8181    virtual PassRefPtr<Transaction> createTransaction();
     
    8787
    8888private:
    89     bool findKeyInIndex(int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey&, Vector<char>& foundEncodedPrimaryKey);
     89    bool findKeyInIndex(IDBBackingStore::Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey&, Vector<char>& foundEncodedPrimaryKey);
    9090
    9191    String m_identifier;
     
    9393    OwnPtr<LevelDBDatabase> m_db;
    9494    OwnPtr<LevelDBComparator> m_comparator;
    95     RefPtr<LevelDBTransaction> m_currentTransaction;
    9695
    9796    class Transaction : public IDBBackingStore::Transaction {
     
    102101        virtual void rollback();
    103102
     103        static LevelDBTransaction* levelDBTransactionFrom(IDBBackingStore::Transaction* transaction)
     104        {
     105            return static_cast<IDBLevelDBBackingStore::Transaction*>(transaction)->m_transaction.get();
     106        }
     107
    104108    private:
    105109        Transaction(IDBLevelDBBackingStore*);
    106110        IDBLevelDBBackingStore* m_backingStore;
     111        RefPtr<LevelDBTransaction> m_transaction;
    107112    };
    108113};
  • trunk/Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendImpl.cpp

    r128217 r129066  
    8787    RefPtr<IDBTransactionBackendImpl> transaction = IDBTransactionBackendImpl::from(transactionPtr);
    8888    if (!transaction->scheduleTask(
    89             createCallbackTask(&IDBObjectStoreBackendImpl::getInternal, objectStore, keyRange, callbacks)))
    90         ec = IDBDatabaseException::TRANSACTION_INACTIVE_ERR;
    91 }
    92 
    93 void IDBObjectStoreBackendImpl::getInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl> objectStore, PassRefPtr<IDBKeyRange> keyRange, PassRefPtr<IDBCallbacks> callbacks)
     89            createCallbackTask(&IDBObjectStoreBackendImpl::getInternal, objectStore, keyRange, callbacks, transaction)))
     90        ec = IDBDatabaseException::TRANSACTION_INACTIVE_ERR;
     91}
     92
     93void IDBObjectStoreBackendImpl::getInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl> objectStore, PassRefPtr<IDBKeyRange> keyRange, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<IDBTransactionBackendImpl> transaction)
    9494{
    9595    IDB_TRACE("IDBObjectStoreBackendImpl::getInternal");
     
    9898        key = keyRange->lower();
    9999    else {
    100         RefPtr<IDBBackingStore::Cursor> backingStoreCursor = objectStore->backingStore()->openObjectStoreCursor(objectStore->databaseId(), objectStore->id(), keyRange.get(), IDBCursor::NEXT);
     100        RefPtr<IDBBackingStore::Cursor> backingStoreCursor = objectStore->backingStore()->openObjectStoreCursor(transaction->backingStoreTransaction(), objectStore->databaseId(), objectStore->id(), keyRange.get(), IDBCursor::NEXT);
    101101        if (!backingStoreCursor) {
    102102            callbacks->onSuccess(SerializedScriptValue::undefinedValue());
     
    107107    }
    108108
    109     String wireData = objectStore->backingStore()->getObjectStoreRecord(objectStore->databaseId(), objectStore->id(), *key);
     109    String wireData = objectStore->backingStore()->getObjectStoreRecord(transaction->backingStoreTransaction(), objectStore->databaseId(), objectStore->id(), *key);
    110110    if (wireData.isNull()) {
    111111        callbacks->onSuccess(SerializedScriptValue::undefinedValue());
     
    155155    { }
    156156
    157     bool verifyIndexKeys(IDBBackingStore& backingStore,
     157    bool verifyIndexKeys(IDBBackingStore& backingStore, IDBBackingStore::Transaction* transaction,
    158158                         int64_t databaseId, int64_t objectStoreId, int64_t indexId,
    159159                         const IDBKey* primaryKey = 0, String* errorMessage = 0)
    160160    {
    161161        for (size_t i = 0; i < m_indexKeys.size(); ++i) {
    162             if (!addingKeyAllowed(backingStore, databaseId, objectStoreId, indexId,
     162            if (!addingKeyAllowed(backingStore, transaction, databaseId, objectStoreId, indexId,
    163163                                  (m_indexKeys)[i].get(), primaryKey)) {
    164164                if (errorMessage)
     
    171171    }
    172172
    173     bool writeIndexKeys(const IDBBackingStore::ObjectStoreRecordIdentifier* recordIdentifier, IDBBackingStore& backingStore, int64_t databaseId, int64_t objectStoreId, int64_t indexId) const
     173    bool writeIndexKeys(const IDBBackingStore::ObjectStoreRecordIdentifier* recordIdentifier, IDBBackingStore& backingStore, IDBBackingStore::Transaction* transaction, int64_t databaseId, int64_t objectStoreId, int64_t indexId) const
    174174    {
    175175        for (size_t i = 0; i < m_indexKeys.size(); ++i) {
    176             if (!backingStore.deleteIndexDataForRecord(databaseId, objectStoreId, indexId, recordIdentifier))
     176            if (!backingStore.deleteIndexDataForRecord(transaction, databaseId, objectStoreId, indexId, recordIdentifier))
    177177                return false;
    178             if (!backingStore.putIndexDataForRecord(databaseId, objectStoreId, indexId, *(m_indexKeys)[i].get(), recordIdentifier))
     178            if (!backingStore.putIndexDataForRecord(transaction, databaseId, objectStoreId, indexId, *(m_indexKeys)[i].get(), recordIdentifier))
    179179                return false;
    180180        }
     
    186186private:
    187187
    188     bool addingKeyAllowed(IDBBackingStore& backingStore,
     188    bool addingKeyAllowed(IDBBackingStore& backingStore, IDBBackingStore::Transaction* transaction,
    189189                          int64_t databaseId, int64_t objectStoreId, int64_t indexId,
    190190                          const IDBKey* indexKey, const IDBKey* primaryKey) const
     
    194194
    195195        RefPtr<IDBKey> foundPrimaryKey;
    196         bool found = backingStore.keyExistsInIndex(databaseId, objectStoreId, indexId, *indexKey, foundPrimaryKey);
     196        bool found = backingStore.keyExistsInIndex(transaction, databaseId, objectStoreId, indexId, *indexKey, foundPrimaryKey);
    197197        if (!found)
    198198            return true;
     
    207207}
    208208
    209 static bool makeIndexWriters(IDBObjectStoreBackendImpl* objectStore, PassRefPtr<IDBKey> primaryKey, bool keyWasGenerated, const Vector<String> indexNames, const Vector<IDBObjectStoreBackendInterface::IndexKeys>& indexKeys, Vector<OwnPtr<IndexWriter> >* indexWriters, String* errorMessage)
     209static bool makeIndexWriters(PassRefPtr<IDBTransactionBackendImpl> transaction, IDBObjectStoreBackendImpl* objectStore, PassRefPtr<IDBKey> primaryKey, bool keyWasGenerated, const Vector<String> indexNames, const Vector<IDBObjectStoreBackendInterface::IndexKeys>& indexKeys, Vector<OwnPtr<IndexWriter> >* indexWriters, String* errorMessage)
    210210{
    211211    ASSERT(indexNames.size() == indexKeys.size());
     
    231231        OwnPtr<IndexWriter> indexWriter(adoptPtr(new IndexWriter(index->metadata(), keys)));
    232232        if (!indexWriter->verifyIndexKeys(*objectStore->backingStore(),
     233                                          transaction->backingStoreTransaction(),
    233234                                          objectStore->databaseId(),
    234235                                          objectStore->id(),
     
    243244}
    244245
    245 void IDBObjectStoreBackendImpl::setIndexKeys(PassRefPtr<IDBKey> prpPrimaryKey, const Vector<String>& indexNames, const Vector<IndexKeys>& indexKeys, IDBTransactionBackendInterface* transaction)
     246void IDBObjectStoreBackendImpl::setIndexKeys(PassRefPtr<IDBKey> prpPrimaryKey, const Vector<String>& indexNames, const Vector<IndexKeys>& indexKeys, IDBTransactionBackendInterface* transactionPtr)
    246247{
    247248    IDB_TRACE("IDBObjectStoreBackendImpl::setIndexKeys");
    248249    RefPtr<IDBKey> primaryKey = prpPrimaryKey;
     250    RefPtr<IDBTransactionBackendImpl> transaction = IDBTransactionBackendImpl::from(transactionPtr);
    249251
    250252    // FIXME: This method could be asynchronous, but we need to evaluate if it's worth the extra complexity.
    251253    RefPtr<IDBBackingStore::ObjectStoreRecordIdentifier> recordIdentifier = backingStore()->createInvalidRecordIdentifier();
    252     if (!backingStore()->keyExistsInObjectStore(databaseId(), id(), *primaryKey, recordIdentifier.get())) {
     254    if (!backingStore()->keyExistsInObjectStore(transaction->backingStoreTransaction(), databaseId(), id(), *primaryKey, recordIdentifier.get())) {
    253255        transaction->abort();
    254256        return;
     
    257259    Vector<OwnPtr<IndexWriter> > indexWriters;
    258260    String errorMessage;
    259     if (!makeIndexWriters(this, primaryKey, false, indexNames, indexKeys, &indexWriters, &errorMessage)) {
     261    if (!makeIndexWriters(transaction, this, primaryKey, false, indexNames, indexKeys, &indexWriters, &errorMessage)) {
    260262        // FIXME: Need to deal with errorMessage here. makeIndexWriters only fails on uniqueness constraint errors.
    261263        transaction->abort();
     
    267269        if (!indexWriter->writeIndexKeys(recordIdentifier.get(),
    268270                                         *backingStore(),
     271                                         transaction->backingStoreTransaction(),
    269272                                         databaseId(),
    270273                                         m_id,
     
    299302}
    300303
    301 void IDBObjectStoreBackendImpl::putInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl> objectStore, PassRefPtr<SerializedScriptValue> prpValue, PassRefPtr<IDBKey> prpKey, PutMode putMode, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<IDBTransactionBackendImpl> transaction, PassOwnPtr<Vector<String> > popIndexNames, PassOwnPtr<Vector<IndexKeys> > popIndexKeys)
     304void IDBObjectStoreBackendImpl::putInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl> objectStore, PassRefPtr<SerializedScriptValue> prpValue, PassRefPtr<IDBKey> prpKey, PutMode putMode, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<IDBTransactionBackendImpl> prpTransaction, PassOwnPtr<Vector<String> > popIndexNames, PassOwnPtr<Vector<IndexKeys> > popIndexKeys)
    302305{
    303306    IDB_TRACE("IDBObjectStoreBackendImpl::putInternal");
     307    RefPtr<IDBTransactionBackendImpl> transaction = prpTransaction;
    304308    ASSERT(transaction->mode() != IDBTransaction::READ_ONLY);
    305309    RefPtr<SerializedScriptValue> value = prpValue;
     
    312316
    313317    if (putMode != CursorUpdate && autoIncrement && !key) {
    314         RefPtr<IDBKey> autoIncKey = objectStore->generateKey();
     318        RefPtr<IDBKey> autoIncKey = objectStore->generateKey(transaction);
    315319        keyWasGenerated = true;
    316320        if (!autoIncKey->isValid()) {
     
    324328
    325329    RefPtr<IDBBackingStore::ObjectStoreRecordIdentifier> recordIdentifier = objectStore->backingStore()->createInvalidRecordIdentifier();
    326     if (putMode == AddOnly && objectStore->backingStore()->keyExistsInObjectStore(objectStore->databaseId(), objectStore->id(), *key, recordIdentifier.get())) {
     330    if (putMode == AddOnly && objectStore->backingStore()->keyExistsInObjectStore(transaction->backingStoreTransaction(), objectStore->databaseId(), objectStore->id(), *key, recordIdentifier.get())) {
    327331        callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::CONSTRAINT_ERR, "Key already exists in the object store."));
    328332        return;
     
    331335    Vector<OwnPtr<IndexWriter> > indexWriters;
    332336    String errorMessage;
    333     if (!makeIndexWriters(objectStore.get(), key, keyWasGenerated, *indexNames, *indexKeys, &indexWriters, &errorMessage)) {
     337    if (!makeIndexWriters(transaction, objectStore.get(), key, keyWasGenerated, *indexNames, *indexKeys, &indexWriters, &errorMessage)) {
    334338        callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::CONSTRAINT_ERR, errorMessage));
    335339        return;
     
    338342    // Before this point, don't do any mutation.  After this point, rollback the transaction in case of error.
    339343
    340     if (!objectStore->backingStore()->putObjectStoreRecord(objectStore->databaseId(), objectStore->id(), *key, value->toWireString(), recordIdentifier.get())) {
     344    if (!objectStore->backingStore()->putObjectStoreRecord(transaction->backingStoreTransaction(), objectStore->databaseId(), objectStore->id(), *key, value->toWireString(), recordIdentifier.get())) {
    341345        callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::UNKNOWN_ERR, "Error writing data to stable storage."));
    342346        transaction->abort();
     
    348352        if (!indexWriter->writeIndexKeys(recordIdentifier.get(),
    349353                                         *objectStore->backingStore(),
     354                                         transaction->backingStoreTransaction(),
    350355                                         objectStore->databaseId(),
    351356                                         objectStore->m_id,
     
    359364
    360365    if (autoIncrement && putMode != CursorUpdate && key->type() == IDBKey::NumberType)
    361         objectStore->updateKeyGenerator(key.get(), !keyWasGenerated);
     366        objectStore->updateKeyGenerator(transaction, key.get(), !keyWasGenerated);
    362367
    363368    callbacks->onSuccess(key.release());
    364369}
    365370
    366 void IDBObjectStoreBackendImpl::deleteFunction(PassRefPtr<IDBKeyRange> prpKeyRange, PassRefPtr<IDBCallbacks> prpCallbacks, IDBTransactionBackendInterface* transaction, ExceptionCode& ec)
     371void IDBObjectStoreBackendImpl::deleteFunction(PassRefPtr<IDBKeyRange> prpKeyRange, PassRefPtr<IDBCallbacks> prpCallbacks, IDBTransactionBackendInterface* transactionPtr, ExceptionCode& ec)
    367372{
    368373    IDB_TRACE("IDBObjectStoreBackendImpl::delete");
    369374
    370     ASSERT(IDBTransactionBackendImpl::from(transaction)->mode() != IDBTransaction::READ_ONLY);
     375    RefPtr<IDBTransactionBackendImpl> transaction = IDBTransactionBackendImpl::from(transactionPtr);
     376    ASSERT(transaction->mode() != IDBTransaction::READ_ONLY);
    371377
    372378    RefPtr<IDBObjectStoreBackendImpl> objectStore = this;
     
    374380    RefPtr<IDBCallbacks> callbacks = prpCallbacks;
    375381
    376     if (!IDBTransactionBackendImpl::from(transaction)->scheduleTask(
    377             createCallbackTask(&IDBObjectStoreBackendImpl::deleteInternal, objectStore, keyRange, callbacks)))
    378         ec = IDBDatabaseException::TRANSACTION_INACTIVE_ERR;
    379 }
    380 
    381 void IDBObjectStoreBackendImpl::deleteInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl> objectStore, PassRefPtr<IDBKeyRange> keyRange, PassRefPtr<IDBCallbacks> callbacks)
     382    if (!transaction->scheduleTask(
     383            createCallbackTask(&IDBObjectStoreBackendImpl::deleteInternal, objectStore, keyRange, callbacks, transaction)))
     384        ec = IDBDatabaseException::TRANSACTION_INACTIVE_ERR;
     385}
     386
     387void IDBObjectStoreBackendImpl::deleteInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl> objectStore, PassRefPtr<IDBKeyRange> keyRange, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<IDBTransactionBackendImpl> transaction)
    382388{
    383389    IDB_TRACE("IDBObjectStoreBackendImpl::deleteInternal");
    384390    RefPtr<IDBBackingStore::ObjectStoreRecordIdentifier> recordIdentifier;
    385391
    386     RefPtr<IDBBackingStore::Cursor> backingStoreCursor = objectStore->backingStore()->openObjectStoreCursor(objectStore->databaseId(), objectStore->id(), keyRange.get(), IDBCursor::NEXT);
     392    RefPtr<IDBBackingStore::Cursor> backingStoreCursor = objectStore->backingStore()->openObjectStoreCursor(transaction->backingStoreTransaction(), objectStore->databaseId(), objectStore->id(), keyRange.get(), IDBCursor::NEXT);
    387393    if (backingStoreCursor) {
    388394
     
    394400                    continue; // The index object has been created, but does not exist in the database yet.
    395401
    396                 bool success = objectStore->backingStore()->deleteIndexDataForRecord(objectStore->databaseId(), objectStore->id(), it->second->id(), recordIdentifier.get());
     402                bool success = objectStore->backingStore()->deleteIndexDataForRecord(transaction->backingStoreTransaction(), objectStore->databaseId(), objectStore->id(), it->second->id(), recordIdentifier.get());
    397403                ASSERT_UNUSED(success, success);
    398404            }
    399405
    400             objectStore->backingStore()->deleteObjectStoreRecord(objectStore->databaseId(), objectStore->id(), recordIdentifier.get());
     406            objectStore->backingStore()->deleteObjectStoreRecord(transaction->backingStoreTransaction(), objectStore->databaseId(), objectStore->id(), recordIdentifier.get());
    401407
    402408        } while (backingStoreCursor->continueFunction(0));
     
    408414}
    409415
    410 void IDBObjectStoreBackendImpl::clear(PassRefPtr<IDBCallbacks> prpCallbacks, IDBTransactionBackendInterface* transaction, ExceptionCode& ec)
     416void IDBObjectStoreBackendImpl::clear(PassRefPtr<IDBCallbacks> prpCallbacks, IDBTransactionBackendInterface* transactionPtr, ExceptionCode& ec)
    411417{
    412418    IDB_TRACE("IDBObjectStoreBackendImpl::clear");
    413419
    414     ASSERT(IDBTransactionBackendImpl::from(transaction)->mode() != IDBTransaction::READ_ONLY);
     420    RefPtr<IDBTransactionBackendImpl> transaction = IDBTransactionBackendImpl::from(transactionPtr);
     421    ASSERT(transaction->mode() != IDBTransaction::READ_ONLY);
    415422
    416423    RefPtr<IDBObjectStoreBackendImpl> objectStore = this;
    417424    RefPtr<IDBCallbacks> callbacks = prpCallbacks;
    418425
    419     if (!IDBTransactionBackendImpl::from(transaction)->scheduleTask(
    420             createCallbackTask(&IDBObjectStoreBackendImpl::clearInternal, objectStore, callbacks)))
    421         ec = IDBDatabaseException::TRANSACTION_INACTIVE_ERR;
    422 }
    423 
    424 void IDBObjectStoreBackendImpl::clearInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl> objectStore, PassRefPtr<IDBCallbacks> callbacks)
    425 {
    426     objectStore->backingStore()->clearObjectStore(objectStore->databaseId(), objectStore->id());
     426    if (!transaction->scheduleTask(
     427            createCallbackTask(&IDBObjectStoreBackendImpl::clearInternal, objectStore, callbacks, transaction)))
     428        ec = IDBDatabaseException::TRANSACTION_INACTIVE_ERR;
     429}
     430
     431void IDBObjectStoreBackendImpl::clearInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl> objectStore, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<IDBTransactionBackendImpl> transaction)
     432{
     433    objectStore->backingStore()->clearObjectStore(transaction->backingStoreTransaction(), objectStore->databaseId(), objectStore->id());
    427434    callbacks->onSuccess(SerializedScriptValue::undefinedValue());
    428435}
     
    453460{
    454461    int64_t id;
    455     if (!objectStore->backingStore()->createIndex(objectStore->databaseId(), objectStore->id(), index->name(), index->keyPath(), index->unique(), index->multiEntry(), id)) {
     462    if (!objectStore->backingStore()->createIndex(transaction->backingStoreTransaction(), objectStore->databaseId(), objectStore->id(), index->name(), index->keyPath(), index->unique(), index->multiEntry(), id)) {
    456463        transaction->abort();
    457464        return;
     
    493500void IDBObjectStoreBackendImpl::deleteIndexInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl> objectStore, PassRefPtr<IDBIndexBackendImpl> index, PassRefPtr<IDBTransactionBackendImpl> transaction)
    494501{
    495     objectStore->backingStore()->deleteIndex(objectStore->databaseId(), objectStore->id(), index->id());
     502    objectStore->backingStore()->deleteIndex(transaction->backingStoreTransaction(), objectStore->databaseId(), objectStore->id(), index->id());
    496503    transaction->didCompleteTaskEvents();
    497504}
     
    514521    IDB_TRACE("IDBObjectStoreBackendImpl::openCursorInternal");
    515522
    516     RefPtr<IDBBackingStore::Cursor> backingStoreCursor = objectStore->backingStore()->openObjectStoreCursor(objectStore->databaseId(), objectStore->id(), range.get(), direction);
     523    RefPtr<IDBBackingStore::Cursor> backingStoreCursor = objectStore->backingStore()->openObjectStoreCursor(transaction->backingStoreTransaction(), objectStore->databaseId(), objectStore->id(), range.get(), direction);
    517524    // The frontend has begun indexing, so this pauses the transaction
    518525    // until the indexing is complete. This can't happen any earlier
     
    530537}
    531538
    532 void IDBObjectStoreBackendImpl::count(PassRefPtr<IDBKeyRange> range, PassRefPtr<IDBCallbacks> callbacks, IDBTransactionBackendInterface* transaction, ExceptionCode& ec)
     539void IDBObjectStoreBackendImpl::count(PassRefPtr<IDBKeyRange> range, PassRefPtr<IDBCallbacks> callbacks, IDBTransactionBackendInterface* transactionPtr, ExceptionCode& ec)
    533540{
    534541    IDB_TRACE("IDBObjectStoreBackendImpl::count");
    535     if (!IDBTransactionBackendImpl::from(transaction)->scheduleTask(
    536             createCallbackTask(&IDBObjectStoreBackendImpl::countInternal, this, range, callbacks)))
    537         ec = IDBDatabaseException::TRANSACTION_INACTIVE_ERR;
    538 }
    539 
    540 void IDBObjectStoreBackendImpl::countInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl> objectStore, PassRefPtr<IDBKeyRange> range, PassRefPtr<IDBCallbacks> callbacks)
     542    RefPtr<IDBTransactionBackendImpl> transaction = IDBTransactionBackendImpl::from(transactionPtr);
     543    if (!transaction->scheduleTask(
     544            createCallbackTask(&IDBObjectStoreBackendImpl::countInternal, this, range, callbacks, transaction)))
     545        ec = IDBDatabaseException::TRANSACTION_INACTIVE_ERR;
     546}
     547
     548void IDBObjectStoreBackendImpl::countInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl> objectStore, PassRefPtr<IDBKeyRange> range, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<IDBTransactionBackendImpl> transaction)
    541549{
    542550    IDB_TRACE("IDBObjectStoreBackendImpl::countInternal");
    543551    uint32_t count = 0;
    544     RefPtr<IDBBackingStore::Cursor> backingStoreCursor = objectStore->backingStore()->openObjectStoreKeyCursor(objectStore->databaseId(), objectStore->id(), range.get(), IDBCursor::NEXT);
     552    RefPtr<IDBBackingStore::Cursor> backingStoreCursor = objectStore->backingStore()->openObjectStoreKeyCursor(transaction->backingStoreTransaction(), objectStore->databaseId(), objectStore->id(), range.get(), IDBCursor::NEXT);
    545553    if (!backingStoreCursor) {
    546554        callbacks->onSuccess(SerializedScriptValue::numberValue(count));
     
    587595}
    588596
    589 PassRefPtr<IDBKey> IDBObjectStoreBackendImpl::generateKey()
     597PassRefPtr<IDBKey> IDBObjectStoreBackendImpl::generateKey(PassRefPtr<IDBTransactionBackendImpl> transaction)
    590598{
    591599    const int64_t maxGeneratorValue = 9007199254740992LL; // Maximum integer storable as ECMAScript number.
    592     int64_t currentNumber = backingStore()->getKeyGeneratorCurrentNumber(databaseId(), id());
     600    int64_t currentNumber = backingStore()->getKeyGeneratorCurrentNumber(transaction->backingStoreTransaction(), databaseId(), id());
    593601    if (currentNumber < 0 || currentNumber > maxGeneratorValue)
    594602        return IDBKey::createInvalid();
     
    597605}
    598606
    599 void IDBObjectStoreBackendImpl::updateKeyGenerator(const IDBKey* key, bool checkCurrent)
     607void IDBObjectStoreBackendImpl::updateKeyGenerator(PassRefPtr<IDBTransactionBackendImpl> transaction, const IDBKey* key, bool checkCurrent)
    600608{
    601609    ASSERT(key && key->type() == IDBKey::NumberType);
    602     backingStore()->maybeUpdateKeyGeneratorCurrentNumber(databaseId(), id(), static_cast<int64_t>(floor(key->number())) + 1, checkCurrent);
     610    backingStore()->maybeUpdateKeyGeneratorCurrentNumber(transaction->backingStoreTransaction(), databaseId(), id(), static_cast<int64_t>(floor(key->number())) + 1, checkCurrent);
    603611}
    604612
  • trunk/Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendImpl.h

    r126199 r129066  
    101101
    102102    void loadIndexes();
    103     PassRefPtr<IDBKey> generateKey();
    104     void updateKeyGenerator(const IDBKey*, bool checkCurrent);
     103    PassRefPtr<IDBKey> generateKey(PassRefPtr<IDBTransactionBackendImpl>);
     104    void updateKeyGenerator(PassRefPtr<IDBTransactionBackendImpl>, const IDBKey*, bool checkCurrent);
    105105
    106     static void getInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl>, PassRefPtr<IDBKeyRange>, PassRefPtr<IDBCallbacks>);
     106    static void getInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl>, PassRefPtr<IDBKeyRange>, PassRefPtr<IDBCallbacks>, PassRefPtr<IDBTransactionBackendImpl>);
    107107    static void putInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl>, PassRefPtr<SerializedScriptValue>, PassRefPtr<IDBKey>, PutMode, PassRefPtr<IDBCallbacks>, PassRefPtr<IDBTransactionBackendImpl>, PassOwnPtr<Vector<String> > popIndexNames, PassOwnPtr<Vector<IndexKeys> >);
    108     static void deleteInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl>, PassRefPtr<IDBKeyRange>, PassRefPtr<IDBCallbacks>);
     108    static void deleteInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl>, PassRefPtr<IDBKeyRange>, PassRefPtr<IDBCallbacks>, PassRefPtr<IDBTransactionBackendImpl>);
    109109    static void setIndexesReadyInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl>, PassOwnPtr<Vector<String> > popIndexNames, PassRefPtr<IDBTransactionBackendImpl>);
    110     static void clearInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl>, PassRefPtr<IDBCallbacks>);
     110    static void clearInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl>, PassRefPtr<IDBCallbacks>, PassRefPtr<IDBTransactionBackendImpl>);
    111111    static void createIndexInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl>, PassRefPtr<IDBIndexBackendImpl>, PassRefPtr<IDBTransactionBackendImpl>);
    112112    static void deleteIndexInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl>, PassRefPtr<IDBIndexBackendImpl>, PassRefPtr<IDBTransactionBackendImpl>);
    113113    static void openCursorInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl>, PassRefPtr<IDBKeyRange>, IDBCursor::Direction, PassRefPtr<IDBCallbacks>, IDBTransactionBackendInterface::TaskType, PassRefPtr<IDBTransactionBackendImpl>);
    114     static void countInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl>, PassRefPtr<IDBKeyRange>, PassRefPtr<IDBCallbacks>);
     114    static void countInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl>, PassRefPtr<IDBKeyRange>, PassRefPtr<IDBCallbacks>, PassRefPtr<IDBTransactionBackendImpl>);
    115115
    116116    // These are used as setVersion transaction abort tasks.
  • trunk/Source/WebCore/Modules/indexeddb/IDBTransactionBackendImpl.h

    r125728 r129066  
    6666    void addPreemptiveEvent() { m_pendingPreemptiveEvents++; }
    6767    void didCompletePreemptiveEvent() { m_pendingPreemptiveEvents--; ASSERT(m_pendingPreemptiveEvents >= 0); }
     68    IDBBackingStore::Transaction* backingStoreTransaction() { return m_transaction.get(); }
    6869
    6970private:
  • trunk/Source/WebKit/chromium/ChangeLog

    r129054 r129066  
     12012-09-19  Joshua Bell  <jsbell@chromium.org>
     2
     3        IndexedDB: Remove "current transaction" concept from backing store
     4        https://bugs.webkit.org/show_bug.cgi?id=96663
     5
     6        Reviewed by Tony Chang.
     7
     8        Update fake class with new method signatures.
     9
     10        * tests/IDBFakeBackingStore.h:
     11
    1122012-09-19  Terry Anderson  <tdanderson@chromium.org>
    213
  • trunk/Source/WebKit/chromium/tests/IDBFakeBackingStore.h

    r128217 r129066  
    3636    virtual bool getIDBDatabaseMetaData(const String& name, String& foundVersion, int64_t& foundIntVersion, int64_t& foundId) OVERRIDE { return false; }
    3737    virtual bool createIDBDatabaseMetaData(const String& name, const String& version, int64_t intVersion, int64_t& rowId) OVERRIDE { return true; }
    38     virtual bool updateIDBDatabaseMetaData(int64_t rowId, const String& version) OVERRIDE { return false; }
    39     virtual bool updateIDBDatabaseIntVersion(int64_t rowId, int64_t version) OVERRIDE { return false; }
     38    virtual bool updateIDBDatabaseMetaData(Transaction*, int64_t rowId, const String& version) OVERRIDE { return false; }
     39    virtual bool updateIDBDatabaseIntVersion(Transaction*, int64_t rowId, int64_t version) OVERRIDE { return false; }
    4040    virtual bool deleteDatabase(const String& name) OVERRIDE { return false; }
    4141
    4242    virtual void getObjectStores(int64_t databaseId, Vector<int64_t>& foundIds, Vector<String>& foundNames, Vector<IDBKeyPath>& foundKeyPaths, Vector<bool>& foundAutoIncrementFlags) OVERRIDE { }
    43     virtual bool createObjectStore(int64_t databaseId, const String& name, const IDBKeyPath& keyPath, bool autoIncrement, int64_t& assignedObjectStoreId) OVERRIDE { return false; }
    44     virtual void deleteObjectStore(int64_t databaseId, int64_t objectStoreId) OVERRIDE { }
     43    virtual bool createObjectStore(Transaction*, int64_t databaseId, const String& name, const IDBKeyPath& keyPath, bool autoIncrement, int64_t& assignedObjectStoreId) OVERRIDE { return false; }
     44    virtual void deleteObjectStore(Transaction*, int64_t databaseId, int64_t objectStoreId) OVERRIDE { }
    4545
    4646    virtual PassRefPtr<ObjectStoreRecordIdentifier> createInvalidRecordIdentifier() OVERRIDE { return PassRefPtr<ObjectStoreRecordIdentifier>(); }
    4747
    48     virtual String getObjectStoreRecord(int64_t databaseId, int64_t objectStoreId, const IDBKey&) OVERRIDE { return String(); }
    49     virtual bool putObjectStoreRecord(int64_t databaseId, int64_t objectStoreId, const IDBKey&, const String& value, ObjectStoreRecordIdentifier*) OVERRIDE { return false; }
    50     virtual void clearObjectStore(int64_t databaseId, int64_t objectStoreId) OVERRIDE { }
    51     virtual void deleteObjectStoreRecord(int64_t databaseId, int64_t objectStoreId, const ObjectStoreRecordIdentifier*) OVERRIDE { }
    52     virtual int64_t getKeyGeneratorCurrentNumber(int64_t databaseId, int64_t objectStoreId) OVERRIDE { return 0; }
    53     virtual bool maybeUpdateKeyGeneratorCurrentNumber(int64_t databaseId, int64_t objectStoreId, int64_t newNumber, bool checkCurrent) OVERRIDE { return false; }
    54     virtual bool keyExistsInObjectStore(int64_t databaseId, int64_t objectStoreId, const IDBKey&, ObjectStoreRecordIdentifier* foundRecordIdentifier) OVERRIDE { return false; }
     48    virtual String getObjectStoreRecord(Transaction*, int64_t databaseId, int64_t objectStoreId, const IDBKey&) OVERRIDE { return String(); }
     49    virtual bool putObjectStoreRecord(Transaction*, int64_t databaseId, int64_t objectStoreId, const IDBKey&, const String& value, ObjectStoreRecordIdentifier*) OVERRIDE { return false; }
     50    virtual void clearObjectStore(Transaction*, int64_t databaseId, int64_t objectStoreId) OVERRIDE { }
     51    virtual void deleteObjectStoreRecord(Transaction*, int64_t databaseId, int64_t objectStoreId, const ObjectStoreRecordIdentifier*) OVERRIDE { }
     52    virtual int64_t getKeyGeneratorCurrentNumber(Transaction*, int64_t databaseId, int64_t objectStoreId) OVERRIDE { return 0; }
     53    virtual bool maybeUpdateKeyGeneratorCurrentNumber(Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t newNumber, bool checkCurrent) OVERRIDE { return false; }
     54    virtual bool keyExistsInObjectStore(Transaction*, int64_t databaseId, int64_t objectStoreId, const IDBKey&, ObjectStoreRecordIdentifier* foundRecordIdentifier) OVERRIDE { return false; }
    5555
    56     virtual bool forEachObjectStoreRecord(int64_t databaseId, int64_t objectStoreId, ObjectStoreRecordCallback&) OVERRIDE { return false; }
     56    virtual bool forEachObjectStoreRecord(Transaction*, int64_t databaseId, int64_t objectStoreId, ObjectStoreRecordCallback&) OVERRIDE { return false; }
    5757
    5858    virtual void getIndexes(int64_t databaseId, int64_t objectStoreId, Vector<int64_t>& foundIds, Vector<String>& foundNames, Vector<IDBKeyPath>& foundKeyPaths, Vector<bool>& foundUniqueFlags, Vector<bool>& foundMultiEntryFlags) OVERRIDE { }
    59     virtual bool createIndex(int64_t databaseId, int64_t objectStoreId, const String& name, const IDBKeyPath& keyPath, bool isUnique, bool isMultiEntry, int64_t& indexId) OVERRIDE { return false; }
    60     virtual void deleteIndex(int64_t databaseId, int64_t objectStoreId, int64_t indexId) OVERRIDE { }
    61     virtual bool putIndexDataForRecord(int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey&, const ObjectStoreRecordIdentifier*) OVERRIDE { return false; }
    62     virtual bool deleteIndexDataForRecord(int64_t databaseId, int64_t objectStoreId, int64_t indexId, const ObjectStoreRecordIdentifier*) OVERRIDE { return false; }
    63     virtual PassRefPtr<IDBKey> getPrimaryKeyViaIndex(int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey&) OVERRIDE { return PassRefPtr<IDBKey>(); }
    64     virtual bool keyExistsInIndex(int64_t databaseid, int64_t objectStoreId, int64_t indexId, const IDBKey& indexKey, RefPtr<IDBKey>& foundPrimaryKey) OVERRIDE { return false; }
     59    virtual bool createIndex(Transaction*, int64_t databaseId, int64_t objectStoreId, const String& name, const IDBKeyPath& keyPath, bool isUnique, bool isMultiEntry, int64_t& indexId) OVERRIDE { return false; }
     60    virtual void deleteIndex(Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId) OVERRIDE { }
     61    virtual bool putIndexDataForRecord(Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey&, const ObjectStoreRecordIdentifier*) OVERRIDE { return false; }
     62    virtual bool deleteIndexDataForRecord(Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const ObjectStoreRecordIdentifier*) OVERRIDE { return false; }
     63    virtual PassRefPtr<IDBKey> getPrimaryKeyViaIndex(Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey&) OVERRIDE { return PassRefPtr<IDBKey>(); }
     64    virtual bool keyExistsInIndex(Transaction*, int64_t databaseid, int64_t objectStoreId, int64_t indexId, const IDBKey& indexKey, RefPtr<IDBKey>& foundPrimaryKey) OVERRIDE { return false; }
    6565
    66     virtual PassRefPtr<Cursor> openObjectStoreKeyCursor(int64_t databaseId, int64_t objectStoreId, const IDBKeyRange*, IDBCursor::Direction) OVERRIDE { return PassRefPtr<Cursor>(); }
    67     virtual PassRefPtr<Cursor> openObjectStoreCursor(int64_t databaseId, int64_t objectStoreId, const IDBKeyRange*, IDBCursor::Direction) OVERRIDE { return PassRefPtr<Cursor>(); }
    68     virtual PassRefPtr<Cursor> openIndexKeyCursor(int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKeyRange*, IDBCursor::Direction) OVERRIDE { return PassRefPtr<Cursor>(); }
    69     virtual PassRefPtr<Cursor> openIndexCursor(int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKeyRange*, IDBCursor::Direction) OVERRIDE { return PassRefPtr<Cursor>(); }
     66    virtual PassRefPtr<Cursor> openObjectStoreKeyCursor(Transaction*, int64_t databaseId, int64_t objectStoreId, const IDBKeyRange*, IDBCursor::Direction) OVERRIDE { return PassRefPtr<Cursor>(); }
     67    virtual PassRefPtr<Cursor> openObjectStoreCursor(Transaction*, int64_t databaseId, int64_t objectStoreId, const IDBKeyRange*, IDBCursor::Direction) OVERRIDE { return PassRefPtr<Cursor>(); }
     68    virtual PassRefPtr<Cursor> openIndexKeyCursor(Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKeyRange*, IDBCursor::Direction) OVERRIDE { return PassRefPtr<Cursor>(); }
     69    virtual PassRefPtr<Cursor> openIndexCursor(Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKeyRange*, IDBCursor::Direction) OVERRIDE { return PassRefPtr<Cursor>(); }
    7070
    7171    virtual PassRefPtr<Transaction> createTransaction() OVERRIDE { return PassRefPtr<Transaction>(); }
Note: See TracChangeset for help on using the changeset viewer.