void IDBDatabaseBackend::get(int64_t transactionId, int64_t objectStoreId, int64_t indexId, PassRefPtr<IDBKeyRange> keyRange, bool keyOnly, PassRefPtr<IDBCallbacks> callbacks) { LOG(StorageAPI, "IDBDatabaseBackend::get"); IDBTransactionBackend* transaction = m_transactions.get(transactionId); if (!transaction) return; transaction->scheduleGetOperation(m_metadata, objectStoreId, indexId, keyRange, keyOnly ? IndexedDB::CursorKeyOnly : IndexedDB::CursorKeyAndValue, callbacks); }
void IDBDatabaseBackend::openCursor(int64_t transactionId, int64_t objectStoreId, int64_t indexId, PassRefPtr<IDBKeyRange> keyRange, IndexedDB::CursorDirection direction, bool keyOnly, TaskType taskType, PassRefPtr<IDBCallbacks> callbacks) { LOG(StorageAPI, "IDBDatabaseBackend::openCursor"); IDBTransactionBackend* transaction = m_transactions.get(transactionId); if (!transaction) return; transaction->scheduleOpenCursorOperation(objectStoreId, indexId, keyRange, direction, keyOnly ? IndexedDB::CursorKeyOnly : IndexedDB::CursorKeyAndValue, taskType, callbacks); }
void IDBDatabaseBackend::clear(int64_t transactionId, int64_t objectStoreId, PassRefPtr<IDBCallbacks> callbacks) { LOG(StorageAPI, "IDBDatabaseBackend::clear"); IDBTransactionBackend* transaction = m_transactions.get(transactionId); if (!transaction) return; ASSERT(transaction->mode() != IndexedDB::TransactionReadOnly); transaction->scheduleClearOperation(objectStoreId, callbacks); }
void IDBDatabaseBackend::count(int64_t transactionId, int64_t objectStoreId, int64_t indexId, PassRefPtr<IDBKeyRange> keyRange, PassRefPtr<IDBCallbacks> callbacks) { LOG(StorageAPI, "IDBDatabaseBackend::count"); IDBTransactionBackend* transaction = m_transactions.get(transactionId); if (!transaction) return; ASSERT(m_metadata.objectStores.contains(objectStoreId)); transaction->scheduleCountOperation(objectStoreId, indexId, keyRange, callbacks); }
void IDBDatabaseBackend::setIndexesReady(int64_t transactionId, int64_t, const Vector<int64_t>& indexIds) { LOG(StorageAPI, "IDBDatabaseBackend::setIndexesReady"); IDBTransactionBackend* transaction = m_transactions.get(transactionId); if (!transaction) return; transaction->scheduleSetIndexesReadyOperation(indexIds.size()); }
void IDBDatabaseBackend::clearObjectStore(int64_t transactionId, int64_t objectStoreId, PassRefPtr<IDBCallbacks> callbacks) { LOG(StorageAPI, "IDBDatabaseBackend::clearObjectStore %lli in transaction %lli", static_cast<long long>(objectStoreId), static_cast<long long>(transactionId)); IDBTransactionBackend* transaction = m_transactions.get(transactionId); if (!transaction) return; ASSERT(transaction->mode() != IndexedDB::TransactionMode::ReadOnly); transaction->scheduleClearObjectStoreOperation(objectStoreId, callbacks); }
void IDBDatabaseBackend::deleteRange(int64_t transactionId, int64_t objectStoreId, PassRefPtr<IDBKeyRange> keyRange, PassRefPtr<IDBCallbacks> callbacks) { LOG(StorageAPI, "IDBDatabaseBackend::deleteRange"); IDBTransactionBackend* transaction = m_transactions.get(transactionId); if (!transaction) return; ASSERT(transaction->mode() != IndexedDB::TransactionMode::ReadOnly); transaction->scheduleDeleteRangeOperation(objectStoreId, keyRange, callbacks); }
void IDBDatabaseBackend::put(int64_t transactionId, int64_t objectStoreId, PassRefPtr<SharedBuffer> value, PassRefPtr<IDBKey> key, PutMode putMode, PassRefPtr<IDBCallbacks> callbacks, const Vector<int64_t>& indexIds, const Vector<IndexKeys>& indexKeys) { LOG(StorageAPI, "IDBDatabaseBackend::put"); IDBTransactionBackend* transaction = m_transactions.get(transactionId); if (!transaction) return; ASSERT(transaction->mode() != IndexedDB::TransactionReadOnly); const IDBObjectStoreMetadata objectStoreMetadata = m_metadata.objectStores.get(objectStoreId); ASSERT(objectStoreMetadata.autoIncrement || key.get()); transaction->schedulePutOperation(objectStoreMetadata, value, key, putMode, callbacks, indexIds, indexKeys); }
void IDBDatabaseBackend::deleteObjectStore(int64_t transactionId, int64_t objectStoreId) { LOG(StorageAPI, "IDBDatabaseBackend::deleteObjectStore"); IDBTransactionBackend* transaction = m_transactions.get(transactionId); if (!transaction) return; ASSERT(transaction->mode() == IndexedDB::TransactionVersionChange); ASSERT(m_metadata.objectStores.contains(objectStoreId)); const IDBObjectStoreMetadata& objectStoreMetadata = m_metadata.objectStores.get(objectStoreId); transaction->scheduleDeleteObjectStoreOperation(objectStoreMetadata); removeObjectStore(objectStoreId); }
void IDBDatabaseBackend::createObjectStore(int64_t transactionId, int64_t objectStoreId, const String& name, const IDBKeyPath& keyPath, bool autoIncrement) { LOG(StorageAPI, "IDBDatabaseBackend::createObjectStore"); IDBTransactionBackend* transaction = m_transactions.get(transactionId); if (!transaction) return; ASSERT(transaction->mode() == IndexedDB::TransactionVersionChange); ASSERT(!m_metadata.objectStores.contains(objectStoreId)); IDBObjectStoreMetadata objectStoreMetadata(name, objectStoreId, keyPath, autoIncrement, IDBDatabaseBackend::MinimumIndexId); transaction->scheduleCreateObjectStoreOperation(objectStoreMetadata); addObjectStore(objectStoreMetadata, objectStoreId); }
void IDBDatabaseBackend::createIndex(int64_t transactionId, int64_t objectStoreId, int64_t indexId, const String& name, const IDBKeyPath& keyPath, bool unique, bool multiEntry) { LOG(StorageAPI, "IDBDatabaseBackend::createIndex"); IDBTransactionBackend* transaction = m_transactions.get(transactionId); if (!transaction) return; ASSERT(transaction->mode() == IndexedDB::TransactionVersionChange); ASSERT(m_metadata.objectStores.contains(objectStoreId)); const IDBObjectStoreMetadata objectStore = m_metadata.objectStores.get(objectStoreId); ASSERT(!objectStore.indexes.contains(indexId)); const IDBIndexMetadata indexMetadata(name, indexId, keyPath, unique, multiEntry); transaction->scheduleCreateIndexOperation(objectStoreId, indexMetadata); addIndex(objectStoreId, indexMetadata, indexId); }