Changeset 113622 in webkit


Ignore:
Timestamp:
Apr 9, 2012 2:37:08 PM (12 years ago)
Author:
jsbell@chromium.org
Message:

Unreviewed, rolling out r113473.
http://trac.webkit.org/changeset/113473
https://bugs.webkit.org/show_bug.cgi?id=83074

Change does not handle cursor retention of LevelDB iterators

Source/WebCore:

  • Modules/indexeddb/IDBDatabaseBackendImpl.cpp:

(WebCore::IDBDatabaseBackendImpl::~IDBDatabaseBackendImpl):
(WebCore::IDBDatabaseBackendImpl::createObjectStore):
(WebCore::IDBDatabaseBackendImpl::loadObjectStores):

  • Modules/indexeddb/IDBIndexBackendImpl.cpp:

(WebCore::IDBIndexBackendImpl::IDBIndexBackendImpl):
(WebCore::IDBIndexBackendImpl::openCursorInternal):
(WebCore::IDBIndexBackendImpl::countInternal):
(WebCore::IDBIndexBackendImpl::getInternal):
(WebCore::IDBIndexBackendImpl::addingKeyAllowed):

  • Modules/indexeddb/IDBIndexBackendImpl.h:

(WebCore::IDBIndexBackendImpl::create):
(IDBIndexBackendImpl):

  • Modules/indexeddb/IDBObjectStoreBackendImpl.cpp:

(WebCore::IDBObjectStoreBackendImpl::IDBObjectStoreBackendImpl):
(WebCore::IDBObjectStoreBackendImpl::getInternal):
(WebCore::IDBObjectStoreBackendImpl::putInternal):
(WebCore::IDBObjectStoreBackendImpl::deleteInternal):
(WebCore::IDBObjectStoreBackendImpl::clearInternal):
(WebCore):
(WebCore::IDBObjectStoreBackendImpl::createIndex):
(WebCore::IDBObjectStoreBackendImpl::createIndexInternal):
(WebCore::IDBObjectStoreBackendImpl::deleteIndexInternal):
(WebCore::IDBObjectStoreBackendImpl::openCursorInternal):
(WebCore::IDBObjectStoreBackendImpl::countInternal):
(WebCore::IDBObjectStoreBackendImpl::loadIndexes):
(WebCore::IDBObjectStoreBackendImpl::genAutoIncrementKey):

  • Modules/indexeddb/IDBObjectStoreBackendImpl.h:

(WebCore):
(WebCore::IDBObjectStoreBackendImpl::create):
(WebCore::IDBObjectStoreBackendImpl::databaseId):
(IDBObjectStoreBackendImpl):

Source/WebKit/chromium:

  • WebKit.gypi:
  • tests/IDBDatabaseBackendTest.cpp: Removed.
Location:
trunk/Source
Files:
1 deleted
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r113618 r113622  
     12012-04-09  Joshua Bell  <jsbell@chromium.org>
     2
     3        Unreviewed, rolling out r113473.
     4        http://trac.webkit.org/changeset/113473
     5        https://bugs.webkit.org/show_bug.cgi?id=83074
     6
     7        Change does not handle cursor retention of LevelDB iterators
     8
     9        * Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
     10        (WebCore::IDBDatabaseBackendImpl::~IDBDatabaseBackendImpl):
     11        (WebCore::IDBDatabaseBackendImpl::createObjectStore):
     12        (WebCore::IDBDatabaseBackendImpl::loadObjectStores):
     13        * Modules/indexeddb/IDBIndexBackendImpl.cpp:
     14        (WebCore::IDBIndexBackendImpl::IDBIndexBackendImpl):
     15        (WebCore::IDBIndexBackendImpl::openCursorInternal):
     16        (WebCore::IDBIndexBackendImpl::countInternal):
     17        (WebCore::IDBIndexBackendImpl::getInternal):
     18        (WebCore::IDBIndexBackendImpl::addingKeyAllowed):
     19        * Modules/indexeddb/IDBIndexBackendImpl.h:
     20        (WebCore::IDBIndexBackendImpl::create):
     21        (IDBIndexBackendImpl):
     22        * Modules/indexeddb/IDBObjectStoreBackendImpl.cpp:
     23        (WebCore::IDBObjectStoreBackendImpl::IDBObjectStoreBackendImpl):
     24        (WebCore::IDBObjectStoreBackendImpl::getInternal):
     25        (WebCore::IDBObjectStoreBackendImpl::putInternal):
     26        (WebCore::IDBObjectStoreBackendImpl::deleteInternal):
     27        (WebCore::IDBObjectStoreBackendImpl::clearInternal):
     28        (WebCore):
     29        (WebCore::IDBObjectStoreBackendImpl::createIndex):
     30        (WebCore::IDBObjectStoreBackendImpl::createIndexInternal):
     31        (WebCore::IDBObjectStoreBackendImpl::deleteIndexInternal):
     32        (WebCore::IDBObjectStoreBackendImpl::openCursorInternal):
     33        (WebCore::IDBObjectStoreBackendImpl::countInternal):
     34        (WebCore::IDBObjectStoreBackendImpl::loadIndexes):
     35        (WebCore::IDBObjectStoreBackendImpl::genAutoIncrementKey):
     36        * Modules/indexeddb/IDBObjectStoreBackendImpl.h:
     37        (WebCore):
     38        (WebCore::IDBObjectStoreBackendImpl::create):
     39        (WebCore::IDBObjectStoreBackendImpl::databaseId):
     40        (IDBObjectStoreBackendImpl):
     41
    1422012-04-06  James Robinson  <jamesr@chromium.org>
    243
  • trunk/Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.cpp

    r113473 r113622  
    121121IDBDatabaseBackendImpl::~IDBDatabaseBackendImpl()
    122122{
    123     // This check should only be false in tests.
    124     if (m_factory)
    125         m_factory->removeIDBDatabaseBackend(m_identifier);
     123    m_factory->removeIDBDatabaseBackend(m_identifier);
    126124}
    127125
     
    149147    }
    150148
    151     RefPtr<IDBObjectStoreBackendImpl> objectStore = IDBObjectStoreBackendImpl::create(this, name, keyPath, autoIncrement);
     149    RefPtr<IDBObjectStoreBackendImpl> objectStore = IDBObjectStoreBackendImpl::create(m_backingStore.get(), m_id, name, keyPath, autoIncrement);
    152150    ASSERT(objectStore->name() == name);
    153151
     
    388386
    389387    for (size_t i = 0; i < ids.size(); i++)
    390         m_objectStores.set(names[i], IDBObjectStoreBackendImpl::create(this, ids[i], names[i], keyPaths[i], autoIncrementFlags[i]));
     388        m_objectStores.set(names[i], IDBObjectStoreBackendImpl::create(m_backingStore.get(), m_id, ids[i], names[i], keyPaths[i], autoIncrementFlags[i]));
    391389}
    392390
  • trunk/Source/WebCore/Modules/indexeddb/IDBIndexBackendImpl.cpp

    r113473 r113622  
    4242namespace WebCore {
    4343
    44 IDBIndexBackendImpl::IDBIndexBackendImpl(const IDBDatabaseBackendImpl* database, const IDBObjectStoreBackendImpl* objectStoreBackend, int64_t id, const String& name, const String& storeName, const String& keyPath, bool unique, bool multiEntry)
    45     : m_database(database)
     44IDBIndexBackendImpl::IDBIndexBackendImpl(IDBBackingStore* backingStore, int64_t databaseId, const IDBObjectStoreBackendImpl* objectStoreBackend, int64_t id, const String& name, const String& storeName, const String& keyPath, bool unique, bool multiEntry)
     45    : m_backingStore(backingStore)
     46    , m_databaseId(databaseId)
    4647    , m_objectStoreBackend(objectStoreBackend)
    4748    , m_id(id)
     
    5455}
    5556
    56 IDBIndexBackendImpl::IDBIndexBackendImpl(const IDBDatabaseBackendImpl* database, const IDBObjectStoreBackendImpl* objectStoreBackend, const String& name, const String& storeName, const String& keyPath, bool unique, bool multiEntry)
    57     : m_database(database)
     57IDBIndexBackendImpl::IDBIndexBackendImpl(IDBBackingStore* backingStore, int64_t databaseId, const IDBObjectStoreBackendImpl* objectStoreBackend, const String& name, const String& storeName, const String& keyPath, bool unique, bool multiEntry)
     58    : m_backingStore(backingStore)
     59    , m_databaseId(databaseId)
    5860    , m_objectStoreBackend(objectStoreBackend)
    5961    , m_id(InvalidId)
     
    7981    switch (cursorType) {
    8082    case IDBCursorBackendInterface::IndexKeyCursor:
    81         backingStoreCursor = index->backingStore()->openIndexKeyCursor(index->databaseId(), index->m_objectStoreBackend->id(), index->id(), range.get(), direction);
     83        backingStoreCursor = index->m_backingStore->openIndexKeyCursor(index->m_databaseId, index->m_objectStoreBackend->id(), index->id(), range.get(), direction);
    8284        break;
    8385    case IDBCursorBackendInterface::IndexCursor:
    84         backingStoreCursor = index->backingStore()->openIndexCursor(index->databaseId(), index->m_objectStoreBackend->id(), index->id(), range.get(), direction);
     86        backingStoreCursor = index->m_backingStore->openIndexCursor(index->m_databaseId, index->m_objectStoreBackend->id(), index->id(), range.get(), direction);
    8587        break;
    8688    case IDBCursorBackendInterface::ObjectStoreCursor:
     
    130132    uint32_t count = 0;
    131133
    132     RefPtr<IDBBackingStore::Cursor> backingStoreCursor = index->backingStore()->openIndexKeyCursor(index->databaseId(), index->m_objectStoreBackend->id(), index->id(), range.get(), IDBCursor::NEXT);
     134    RefPtr<IDBBackingStore::Cursor> backingStoreCursor = index->m_backingStore->openIndexKeyCursor(index->m_databaseId, index->m_objectStoreBackend->id(), index->id(), range.get(), IDBCursor::NEXT);
    133135    if (!backingStoreCursor) {
    134136        callbacks->onSuccess(SerializedScriptValue::numberValue(count));
     
    155157    // FIXME: Split getInternal into two functions, getting rid off |getObject|.
    156158    if (getObject) {
    157         String value = index->backingStore()->getObjectViaIndex(index->databaseId(), index->m_objectStoreBackend->id(), index->id(), *key);
     159        String value = index->m_backingStore->getObjectViaIndex(index->m_databaseId, index->m_objectStoreBackend->id(), index->id(), *key);
    158160        if (value.isNull()) {
    159161            callbacks->onSuccess(SerializedScriptValue::undefinedValue());
     
    162164        callbacks->onSuccess(SerializedScriptValue::createFromWire(value));
    163165    } else {
    164         RefPtr<IDBKey> keyResult = index->backingStore()->getPrimaryKeyViaIndex(index->databaseId(), index->m_objectStoreBackend->id(), index->id(), *key);
     166        RefPtr<IDBKey> keyResult = index->m_backingStore->getPrimaryKeyViaIndex(index->m_databaseId, index->m_objectStoreBackend->id(), index->id(), *key);
    165167        if (!keyResult) {
    166168            callbacks->onSuccess(static_cast<IDBKey*>(0));
     
    197199
    198200    RefPtr<IDBKey> foundPrimaryKey;
    199     bool found = backingStore()->keyExistsInIndex(databaseId(), m_objectStoreBackend->id(), m_id, *indexKey, foundPrimaryKey);
     201    bool found = m_backingStore->keyExistsInIndex(m_databaseId, m_objectStoreBackend->id(), m_id, *indexKey, foundPrimaryKey);
    200202    if (!found)
    201203        return true;
  • trunk/Source/WebCore/Modules/indexeddb/IDBIndexBackendImpl.h

    r113473 r113622  
    3030
    3131#include "IDBCursorBackendInterface.h"
    32 #include "IDBDatabaseBackendImpl.h"
    3332#include "IDBIndexBackendInterface.h"
    3433
     
    4241class IDBIndexBackendImpl : public IDBIndexBackendInterface {
    4342public:
    44     static PassRefPtr<IDBIndexBackendImpl> create(const IDBDatabaseBackendImpl* database, const IDBObjectStoreBackendImpl* objectStoreBackend, int64_t id, const String& name, const String& storeName, const String& keyPath, bool unique, bool multiEntry)
     43    static PassRefPtr<IDBIndexBackendImpl> create(IDBBackingStore* backingStore, int64_t databaseId, const IDBObjectStoreBackendImpl* objectStoreBackend, int64_t id, const String& name, const String& storeName, const String& keyPath, bool unique, bool multiEntry)
    4544    {
    46         return adoptRef(new IDBIndexBackendImpl(database, objectStoreBackend, id, name, storeName, keyPath, unique, multiEntry));
     45        return adoptRef(new IDBIndexBackendImpl(backingStore, databaseId, objectStoreBackend, id, name, storeName, keyPath, unique, multiEntry));
    4746    }
    48     static PassRefPtr<IDBIndexBackendImpl> create(const IDBDatabaseBackendImpl* database, const IDBObjectStoreBackendImpl* objectStoreBackend, const String& name, const String& storeName, const String& keyPath, bool unique, bool multiEntry)
     47    static PassRefPtr<IDBIndexBackendImpl> create(IDBBackingStore* backingStore, int64_t databaseId, const IDBObjectStoreBackendImpl* objectStoreBackend, const String& name, const String& storeName, const String& keyPath, bool unique, bool multiEntry)
    4948    {
    50         return adoptRef(new IDBIndexBackendImpl(database, objectStoreBackend, name, storeName, keyPath, unique, multiEntry));
     49        return adoptRef(new IDBIndexBackendImpl(backingStore, databaseId, objectStoreBackend, name, storeName, keyPath, unique, multiEntry));
    5150    }
    5251    virtual ~IDBIndexBackendImpl();
     
    7675
    7776private:
    78     IDBIndexBackendImpl(const IDBDatabaseBackendImpl*, const IDBObjectStoreBackendImpl*, int64_t, const String&, const String&, const String&, bool, bool);
    79     IDBIndexBackendImpl(const IDBDatabaseBackendImpl*, const IDBObjectStoreBackendImpl*, const String&, const String&, const String&, bool, bool);
     77    IDBIndexBackendImpl(IDBBackingStore*, int64_t databaseId, const IDBObjectStoreBackendImpl*, int64_t id, const String& name, const String& storeName, const String& keyPath, bool unique, bool multiEntry);
     78    IDBIndexBackendImpl(IDBBackingStore*, int64_t databaseId, const IDBObjectStoreBackendImpl*, const String& name, const String& storeName, const String& keyPath, bool unique, bool multiEntry);
    8079
    8180    static void openCursorInternal(ScriptExecutionContext*, PassRefPtr<IDBIndexBackendImpl>, PassRefPtr<IDBKeyRange>, unsigned short direction, IDBCursorBackendInterface::CursorType, PassRefPtr<IDBCallbacks>, PassRefPtr<IDBTransactionBackendInterface>);
     
    8584    static const int64_t InvalidId = 0;
    8685
    87     PassRefPtr<IDBBackingStore> backingStore() const { return m_database->backingStore(); }
    88     int64_t databaseId() const { return m_database->id(); }
     86    RefPtr<IDBBackingStore> m_backingStore;
    8987
    90     const IDBDatabaseBackendImpl* m_database;
    91 
     88    int64_t m_databaseId;
    9289    const IDBObjectStoreBackendImpl* m_objectStoreBackend;
    9390    int64_t m_id;
  • trunk/Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendImpl.cpp

    r113473 r113622  
    5252}
    5353
    54 IDBObjectStoreBackendImpl::IDBObjectStoreBackendImpl(const IDBDatabaseBackendImpl* database, int64_t id, const String& name, const String& keyPath, bool autoIncrement)
    55     : m_database(database)
     54IDBObjectStoreBackendImpl::IDBObjectStoreBackendImpl(IDBBackingStore* backingStore, int64_t databaseId, int64_t id, const String& name, const String& keyPath, bool autoIncrement)
     55    : m_backingStore(backingStore)
     56    , m_databaseId(databaseId)
    5657    , m_id(id)
    5758    , m_name(name)
     
    6364}
    6465
    65 IDBObjectStoreBackendImpl::IDBObjectStoreBackendImpl(const IDBDatabaseBackendImpl* database, const String& name, const String& keyPath, bool autoIncrement)
    66     : m_database(database)
     66IDBObjectStoreBackendImpl::IDBObjectStoreBackendImpl(IDBBackingStore* backingStore, int64_t databaseId, const String& name, const String& keyPath, bool autoIncrement)
     67    : m_backingStore(backingStore)
     68    , m_databaseId(databaseId)
    6769    , m_id(InvalidId)
    6870    , m_name(name)
     
    9597{
    9698    IDB_TRACE("IDBObjectStoreBackendImpl::getInternal");
    97     String wireData = objectStore->backingStore()->getObjectStoreRecord(objectStore->databaseId(), objectStore->id(), *key);
     99    String wireData = objectStore->m_backingStore->getObjectStoreRecord(objectStore->m_databaseId, objectStore->id(), *key);
    98100    if (wireData.isNull()) {
    99101        callbacks->onSuccess(SerializedScriptValue::undefinedValue());
     
    244246    ASSERT(key && key->valid());
    245247
    246     RefPtr<IDBBackingStore::ObjectStoreRecordIdentifier> recordIdentifier = objectStore->backingStore()->createInvalidRecordIdentifier();
    247     if (putMode == AddOnly && objectStore->backingStore()->keyExistsInObjectStore(objectStore->databaseId(), objectStore->id(), *key, recordIdentifier.get())) {
     248    RefPtr<IDBBackingStore::ObjectStoreRecordIdentifier> recordIdentifier = objectStore->m_backingStore->createInvalidRecordIdentifier();
     249    if (putMode == AddOnly && objectStore->m_backingStore->keyExistsInObjectStore(objectStore->m_databaseId, objectStore->id(), *key, recordIdentifier.get())) {
    248250        objectStore->resetAutoIncrementKeyCache();
    249251        callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::CONSTRAINT_ERR, "Key already exists in the object store."));
     
    283285    // Before this point, don't do any mutation.  After this point, rollback the transaction in case of error.
    284286
    285     if (!objectStore->backingStore()->putObjectStoreRecord(objectStore->databaseId(), objectStore->id(), *key, value->toWireString(), recordIdentifier.get())) {
     287    if (!objectStore->m_backingStore->putObjectStoreRecord(objectStore->m_databaseId, objectStore->id(), *key, value->toWireString(), recordIdentifier.get())) {
    286288        // FIXME: The Indexed Database specification does not have an error code dedicated to I/O errors.
    287289        callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::UNKNOWN_ERR, "Error writing data to stable storage."));
     
    296298            continue; // The index object has been created, but does not exist in the database yet.
    297299
    298         if (!objectStore->backingStore()->deleteIndexDataForRecord(objectStore->databaseId(), objectStore->id(), index->id(), recordIdentifier.get())) {
     300        if (!objectStore->m_backingStore->deleteIndexDataForRecord(objectStore->m_databaseId, objectStore->id(), index->id(), recordIdentifier.get())) {
    299301            // FIXME: The Indexed Database specification does not have an error code dedicated to I/O errors.
    300302            callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::UNKNOWN_ERR, "Error writing data to stable storage."));
     
    308310
    309311        if (!index->multiEntry() || indexKey->type() != IDBKey::ArrayType) {
    310             if (!objectStore->backingStore()->putIndexDataForRecord(objectStore->databaseId(), objectStore->id(), index->id(), *indexKey, recordIdentifier.get())) {
     312            if (!objectStore->m_backingStore->putIndexDataForRecord(objectStore->m_databaseId, objectStore->id(), index->id(), *indexKey, recordIdentifier.get())) {
    311313                // FIXME: The Indexed Database specification does not have an error code dedicated to I/O errors.
    312314                callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::UNKNOWN_ERR, "Error writing data to stable storage."));
     
    318320            ASSERT(indexKey->type() == IDBKey::ArrayType);
    319321            for (size_t j = 0; j < indexKey->array().size(); ++j) {
    320                 if (!objectStore->backingStore()->putIndexDataForRecord(objectStore->databaseId(), objectStore->id(), index->id(), *indexKey->array()[j], recordIdentifier.get())) {
     322                if (!objectStore->m_backingStore->putIndexDataForRecord(objectStore->m_databaseId, objectStore->id(), index->id(), *indexKey->array()[j], recordIdentifier.get())) {
    321323                    // FIXME: The Indexed Database specification does not have an error code dedicated to I/O errors.
    322324                    callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::UNKNOWN_ERR, "Error writing data to stable storage."));
     
    368370    RefPtr<IDBBackingStore::ObjectStoreRecordIdentifier> recordIdentifier;
    369371
    370     RefPtr<IDBBackingStore::Cursor> backingStoreCursor = objectStore->backingStore()->openObjectStoreCursor(objectStore->databaseId(), objectStore->id(), keyRange.get(), IDBCursor::NEXT);
     372    RefPtr<IDBBackingStore::Cursor> backingStoreCursor = objectStore->m_backingStore->openObjectStoreCursor(objectStore->m_databaseId, objectStore->id(), keyRange.get(), IDBCursor::NEXT);
    371373    if (backingStoreCursor) {
    372374
     
    378380                    continue; // The index object has been created, but does not exist in the database yet.
    379381
    380                 bool success = objectStore->backingStore()->deleteIndexDataForRecord(objectStore->databaseId(), objectStore->id(), it->second->id(), recordIdentifier.get());
     382                bool success = objectStore->m_backingStore->deleteIndexDataForRecord(objectStore->m_databaseId, objectStore->id(), it->second->id(), recordIdentifier.get());
    381383                ASSERT_UNUSED(success, success);
    382384            }
    383385
    384             objectStore->backingStore()->deleteObjectStoreRecord(objectStore->databaseId(), objectStore->id(), recordIdentifier.get());
     386            objectStore->m_backingStore->deleteObjectStoreRecord(objectStore->m_databaseId, objectStore->id(), recordIdentifier.get());
    385387
    386388        } while (backingStoreCursor->continueFunction(0));
     
    409411void IDBObjectStoreBackendImpl::clearInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl> objectStore, PassRefPtr<IDBCallbacks> callbacks)
    410412{
    411     objectStore->backingStore()->clearObjectStore(objectStore->databaseId(), objectStore->id());
     413    objectStore->m_backingStore->clearObjectStore(objectStore->m_databaseId, objectStore->id());
    412414    callbacks->onSuccess(SerializedScriptValue::undefinedValue());
    413415}
     
    481483    }
    482484
    483     RefPtr<IDBIndexBackendImpl> index = IDBIndexBackendImpl::create(m_database, this, name, m_name, keyPath, unique, multiEntry);
     485    RefPtr<IDBIndexBackendImpl> index = IDBIndexBackendImpl::create(m_backingStore.get(), m_databaseId, this, name, m_name, keyPath, unique, multiEntry);
    484486    ASSERT(index->name() == name);
    485487
     
    502504{
    503505    int64_t id;
    504     if (!objectStore->backingStore()->createIndex(objectStore->databaseId(), objectStore->id(), index->name(), index->keyPath(), index->unique(), index->multiEntry(), id)) {
     506    if (!objectStore->m_backingStore->createIndex(objectStore->m_databaseId, objectStore->id(), index->name(), index->keyPath(), index->unique(), index->multiEntry(), id)) {
    505507        transaction->abort();
    506508        return;
     
    509511    index->setId(id);
    510512
    511     if (!populateIndex(*objectStore->backingStore(), objectStore->databaseId(), objectStore->m_id, index)) {
     513    if (!populateIndex(*objectStore->m_backingStore, objectStore->m_databaseId, objectStore->m_id, index)) {
    512514        transaction->abort();
    513515        return;
     
    555557void IDBObjectStoreBackendImpl::deleteIndexInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl> objectStore, PassRefPtr<IDBIndexBackendImpl> index, PassRefPtr<IDBTransactionBackendInterface> transaction)
    556558{
    557     objectStore->backingStore()->deleteIndex(objectStore->databaseId(), objectStore->id(), index->id());
     559    objectStore->m_backingStore->deleteIndex(objectStore->m_databaseId, objectStore->id(), index->id());
    558560    transaction->didCompleteTaskEvents();
    559561}
     
    578580    IDBCursor::Direction direction = static_cast<IDBCursor::Direction>(tmpDirection);
    579581
    580     RefPtr<IDBBackingStore::Cursor> backingStoreCursor = objectStore->backingStore()->openObjectStoreCursor(objectStore->databaseId(), objectStore->id(), range.get(), direction);
     582    RefPtr<IDBBackingStore::Cursor> backingStoreCursor = objectStore->m_backingStore->openObjectStoreCursor(objectStore->m_databaseId, objectStore->id(), range.get(), direction);
    581583    if (!backingStoreCursor) {
    582584        callbacks->onSuccess(SerializedScriptValue::nullValue());
     
    599601    IDB_TRACE("IDBObjectStoreBackendImpl::countInternal");
    600602    uint32_t count = 0;
    601     RefPtr<IDBBackingStore::Cursor> backingStoreCursor = objectStore->backingStore()->openObjectStoreCursor(objectStore->databaseId(), objectStore->id(), range.get(), IDBCursor::NEXT);
     603    RefPtr<IDBBackingStore::Cursor> backingStoreCursor = objectStore->m_backingStore->openObjectStoreCursor(objectStore->m_databaseId, objectStore->id(), range.get(), IDBCursor::NEXT);
    602604    if (!backingStoreCursor) {
    603605        callbacks->onSuccess(SerializedScriptValue::numberValue(count));
     
    620622    Vector<bool> uniqueFlags;
    621623    Vector<bool> multiEntryFlags;
    622     backingStore()->getIndexes(databaseId(), m_id, ids, names, keyPaths, uniqueFlags, multiEntryFlags);
     624    m_backingStore->getIndexes(m_databaseId, m_id, ids, names, keyPaths, uniqueFlags, multiEntryFlags);
    623625
    624626    ASSERT(names.size() == ids.size());
     
    628630
    629631    for (size_t i = 0; i < ids.size(); i++)
    630         m_indexes.set(names[i], IDBIndexBackendImpl::create(m_database, this, ids[i], names[i], m_name, keyPaths[i], uniqueFlags[i], multiEntryFlags[i]));
     632        m_indexes.set(names[i], IDBIndexBackendImpl::create(m_backingStore.get(), m_databaseId, this, ids[i], names[i], m_name, keyPaths[i], uniqueFlags[i], multiEntryFlags[i]));
    631633}
    632634
     
    649651        return IDBKey::createNumber(m_autoIncrementNumber++);
    650652
    651     m_autoIncrementNumber = static_cast<int>(backingStore()->nextAutoIncrementNumber(databaseId(), id()));
     653    m_autoIncrementNumber = static_cast<int>(m_backingStore->nextAutoIncrementNumber(m_databaseId, id()));
    652654    return IDBKey::createNumber(m_autoIncrementNumber++);
    653655}
  • trunk/Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendImpl.h

    r113473 r113622  
    2727#define IDBObjectStoreBackendImpl_h
    2828
    29 #include "IDBDatabaseBackendImpl.h"
    3029#include "IDBObjectStoreBackendInterface.h"
    3130#include <wtf/HashMap.h>
     
    3635namespace WebCore {
    3736
     37class IDBBackingStore;
    3838class IDBDatabaseBackendImpl;
    3939class IDBIndexBackendImpl;
     
    4343class IDBObjectStoreBackendImpl : public IDBObjectStoreBackendInterface {
    4444public:
    45     static PassRefPtr<IDBObjectStoreBackendImpl> create(const IDBDatabaseBackendImpl* database, int64_t id, const String& name, const String& keyPath, bool autoIncrement)
     45    static PassRefPtr<IDBObjectStoreBackendImpl> create(IDBBackingStore* backingStore, int64_t databaseId, int64_t id, const String& name, const String& keyPath, bool autoIncrement)
    4646    {
    47         return adoptRef(new IDBObjectStoreBackendImpl(database, id, name, keyPath, autoIncrement));
     47        return adoptRef(new IDBObjectStoreBackendImpl(backingStore, databaseId, id, name, keyPath, autoIncrement));
    4848    }
    49     static PassRefPtr<IDBObjectStoreBackendImpl> create(const IDBDatabaseBackendImpl* database, const String& name, const String& keyPath, bool autoIncrement)
     49    static PassRefPtr<IDBObjectStoreBackendImpl> create(IDBBackingStore* backingStore, int64_t databaseId, const String& name, const String& keyPath, bool autoIncrement)
    5050    {
    51         return adoptRef(new IDBObjectStoreBackendImpl(database, name, keyPath, autoIncrement));
     51        return adoptRef(new IDBObjectStoreBackendImpl(backingStore, databaseId, name, keyPath, autoIncrement));
    5252    }
    5353    virtual ~IDBObjectStoreBackendImpl();
     
    6060    }
    6161    void setId(int64_t id) { m_id = id; }
     62    int64_t databaseId() const { return m_databaseId; }
    6263
    6364    virtual String name() const { return m_name; }
     
    8283
    8384private:
    84     IDBObjectStoreBackendImpl(const IDBDatabaseBackendImpl*, int64_t, const String&, const String&, bool);
    85     IDBObjectStoreBackendImpl(const IDBDatabaseBackendImpl*, const String&, const String&, bool);
     85    IDBObjectStoreBackendImpl(IDBBackingStore*, int64_t databaseId, int64_t id, const String& name, const String& keyPath, bool autoIncrement);
     86    IDBObjectStoreBackendImpl(IDBBackingStore*, int64_t databaseId, const String& name, const String& keyPath, bool autoIncrement);
    8687
    8788    void loadIndexes();
     
    103104    static void revertAutoIncrementKeyCache(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl>);
    104105
    105     PassRefPtr<IDBBackingStore> backingStore() const { return m_database->backingStore(); }
    106     int64_t databaseId() const { return m_database->id(); }
     106    RefPtr<IDBBackingStore> m_backingStore;
    107107
    108     const IDBDatabaseBackendImpl* m_database;
     108    int64_t m_databaseId;
    109109    int64_t m_id;
    110110    String m_name;
  • trunk/Source/WebKit/chromium/ChangeLog

    r113618 r113622  
     12012-04-09  Joshua Bell  <jsbell@chromium.org>
     2
     3        Unreviewed, rolling out r113473.
     4        http://trac.webkit.org/changeset/113473
     5        https://bugs.webkit.org/show_bug.cgi?id=83074
     6
     7        Change does not handle cursor retention of LevelDB iterators
     8
     9        * WebKit.gypi:
     10        * tests/IDBDatabaseBackendTest.cpp: Removed.
     11
    1122012-04-06  James Robinson  <jamesr@chromium.org>
    213
  • trunk/Source/WebKit/chromium/WebKit.gypi

    r113473 r113622  
    103103            'tests/FrameTestHelpers.h',
    104104            'tests/IDBBindingUtilitiesTest.cpp',
    105             'tests/IDBDatabaseBackendTest.cpp',
    106105            'tests/IDBKeyPathTest.cpp',
    107106            'tests/IDBLevelDBCodingTest.cpp',
Note: See TracChangeset for help on using the changeset viewer.