IDBError MemoryIDBBackingStore::getRecord(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyRangeData& range, ThreadSafeDataBuffer& outValue) { LOG(IndexedDB, "MemoryIDBBackingStore::getRecord"); ASSERT(objectStoreIdentifier); if (!m_transactions.contains(transactionIdentifier)) return IDBError(IDBDatabaseException::UnknownError, ASCIILiteral("No backing store transaction found to get record")); MemoryObjectStore* objectStore = m_objectStoresByIdentifier.get(objectStoreIdentifier); if (!objectStore) return IDBError(IDBDatabaseException::UnknownError, ASCIILiteral("No backing store object store found")); outValue = objectStore->valueForKeyRange(range); return IDBError(); }
IDBError MemoryIDBBackingStore::getRecord(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyRangeData& range, IDBGetRecordDataType type, IDBGetResult& outValue) { LOG(IndexedDB, "MemoryIDBBackingStore::getRecord"); ASSERT(objectStoreIdentifier); if (!m_transactions.contains(transactionIdentifier)) return { IDBDatabaseException::UnknownError, ASCIILiteral("No backing store transaction found to get record") }; MemoryObjectStore* objectStore = m_objectStoresByIdentifier.get(objectStoreIdentifier); if (!objectStore) return { IDBDatabaseException::UnknownError, ASCIILiteral("No backing store object store found") }; switch (type) { case IDBGetRecordDataType::KeyAndValue: outValue = objectStore->valueForKeyRange(range); break; case IDBGetRecordDataType::KeyOnly: outValue = objectStore->lowestKeyWithRecordInRange(range); break; } return { }; }