예제 #1
0
IDBError MemoryObjectStore::deleteIndex(MemoryBackingStoreTransaction& transaction, const String& indexName)
{
    LOG(IndexedDB, "MemoryObjectStore::deleteIndex");

    if (!m_writeTransaction || !m_writeTransaction->isVersionChange() || m_writeTransaction != &transaction)
        return IDBError(IDBDatabaseException::ConstraintError);
    
    auto index = takeIndexByName(indexName);
    ASSERT(index);
    if (!index)
        return IDBError(IDBDatabaseException::ConstraintError);

    m_info.deleteIndex(indexName);
    transaction.indexDeleted(WTFMove(index));

    return { };
}
예제 #2
0
IDBError MemoryObjectStore::deleteIndex(MemoryBackingStoreTransaction& transaction, uint64_t indexIdentifier)
{
    LOG(IndexedDB, "MemoryObjectStore::deleteIndex");

    if (!m_writeTransaction || !m_writeTransaction->isVersionChange() || m_writeTransaction != &transaction)
        return IDBError(IDBDatabaseException::ConstraintError);
    
    auto index = takeIndexByIdentifier(indexIdentifier);
    ASSERT(index);
    if (!index)
        return IDBError(IDBDatabaseException::ConstraintError);

    m_info.deleteIndex(indexIdentifier);
    transaction.indexDeleted(*index);

    return { };
}