Modern IDB:Make in-memory Index cursors work.
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 19 Nov 2015 04:36:00 +0000 (04:36 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 19 Nov 2015 04:36:00 +0000 (04:36 +0000)
commit930c559840250892c98fd85e2c5914ae89d120c4
tree5488fcb79fcfb3ce4c067ecd98383cf9bb0078d6
parentb531243baa3bb1b4d287719c5f5fb94d62b5335d
Modern IDB:Make in-memory Index cursors work.
https://bugs.webkit.org/show_bug.cgi?id=151278

Reviewed by Alex Christensen.

Source/WebCore:

Tests: storage/indexeddb/modern/index-cursor-1.html
       storage/indexeddb/modern/index-cursor-2.html
       storage/indexeddb/modern/index-cursor-3.html

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:

* Modules/indexeddb/client/IDBIndexImpl.cpp:
(WebCore::IDBClient::IDBIndex::openCursor):
(WebCore::IDBClient::IDBIndex::openKeyCursor):

* Modules/indexeddb/server/IndexValueEntry.cpp:
(WebCore::IDBServer::IndexValueEntry::removeKey):
(WebCore::IDBServer::IndexValueEntry::Iterator::Iterator):
(WebCore::IDBServer::IndexValueEntry::Iterator::key):
(WebCore::IDBServer::IndexValueEntry::Iterator::isValid):
(WebCore::IDBServer::IndexValueEntry::Iterator::invalidate):
(WebCore::IDBServer::IndexValueEntry::Iterator::operator++):
(WebCore::IDBServer::IndexValueEntry::begin):
(WebCore::IDBServer::IndexValueEntry::reverseBegin):
(WebCore::IDBServer::IndexValueEntry::find):
(WebCore::IDBServer::IndexValueEntry::reverseFind):
* Modules/indexeddb/server/IndexValueEntry.h:
(WebCore::IDBServer::IndexValueEntry::Iterator::Iterator):
(WebCore::IDBServer::IndexValueEntry::unique):

* Modules/indexeddb/server/IndexValueStore.cpp:
(WebCore::IDBServer::IndexValueStore::removeEntriesWithValueKey):
(WebCore::IDBServer::IndexValueStore::lowestKeyWithRecordInRange):
(WebCore::IDBServer::IndexValueStore::lowestIteratorInRange):
(WebCore::IDBServer::IndexValueStore::highestReverseIteratorInRange):
(WebCore::IDBServer::IndexValueStore::find):
(WebCore::IDBServer::IndexValueStore::reverseFind):
(WebCore::IDBServer::IndexValueStore::Iterator::Iterator):
(WebCore::IDBServer::IndexValueStore::Iterator::nextIndexEntry):
(WebCore::IDBServer::IndexValueStore::Iterator::operator++):
(WebCore::IDBServer::IndexValueStore::Iterator::invalidate):
(WebCore::IDBServer::IndexValueStore::Iterator::isValid):
(WebCore::IDBServer::IndexValueStore::Iterator::key):
(WebCore::IDBServer::IndexValueStore::Iterator::primaryKey):
* Modules/indexeddb/server/IndexValueStore.h:
(WebCore::IDBServer::IndexValueStore::Iterator::Iterator):

* Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
(WebCore::IDBServer::MemoryIDBBackingStore::openCursor):

* Modules/indexeddb/server/MemoryIndex.cpp:
(WebCore::IDBServer::MemoryIndex::cursorDidBecomeClean):
(WebCore::IDBServer::MemoryIndex::cursorDidBecomeDirty):
(WebCore::IDBServer::MemoryIndex::objectStoreCleared):
(WebCore::IDBServer::MemoryIndex::notifyCursorsOfValueChange):
(WebCore::IDBServer::MemoryIndex::notifyCursorsOfAllRecordsChanged):
(WebCore::IDBServer::MemoryIndex::putIndexKey):
(WebCore::IDBServer::MemoryIndex::removeRecord):
(WebCore::IDBServer::MemoryIndex::removeEntriesWithValueKey):
(WebCore::IDBServer::MemoryIndex::maybeOpenCursor):
* Modules/indexeddb/server/MemoryIndex.h:
(WebCore::IDBServer::MemoryIndex::valueStore):
(WebCore::IDBServer::MemoryIndex::objectStore):

* Modules/indexeddb/server/MemoryIndexCursor.cpp: Added.
(WebCore::IDBServer::MemoryIndexCursor::MemoryIndexCursor):
(WebCore::IDBServer::MemoryIndexCursor::~MemoryIndexCursor):
(WebCore::IDBServer::MemoryIndexCursor::currentData):
(WebCore::IDBServer::MemoryIndexCursor::iterate):
(WebCore::IDBServer::MemoryIndexCursor::indexRecordsAllChanged):
(WebCore::IDBServer::MemoryIndexCursor::indexValueChanged):
* Modules/indexeddb/server/MemoryIndexCursor.h:

* Modules/indexeddb/server/MemoryObjectStore.cpp:
(WebCore::IDBServer::MemoryObjectStore::indexForIdentifier):
(WebCore::IDBServer::MemoryObjectStore::valueForKey):
* Modules/indexeddb/server/MemoryObjectStore.h:

* Modules/indexeddb/shared/IDBCursorInfo.cpp:
(WebCore::IDBCursorInfo::objectStoreCursor):
(WebCore::IDBCursorInfo::indexCursor):
(WebCore::IDBCursorInfo::IDBCursorInfo):
(WebCore::IDBCursorInfo::isDirectionNoDuplicate):
(WebCore::IDBCursorInfo::isolatedCopy):
* Modules/indexeddb/shared/IDBCursorInfo.h:
(WebCore::IDBCursorInfo::objectStoreIdentifier):

LayoutTests:

* storage/indexeddb/modern/cursor-1-expected.txt:
* storage/indexeddb/modern/index-cursor-1-expected.txt: Added.
* storage/indexeddb/modern/index-cursor-1.html: Added.
* storage/indexeddb/modern/index-cursor-2-expected.txt: Added.
* storage/indexeddb/modern/index-cursor-2.html: Added.
* storage/indexeddb/modern/index-cursor-3-expected.txt: Added.
* storage/indexeddb/modern/index-cursor-3.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@192610 268f45cc-cd09-0410-ab3c-d52691b4dbfc
25 files changed:
LayoutTests/ChangeLog
LayoutTests/storage/indexeddb/modern/cursor-1-expected.txt
LayoutTests/storage/indexeddb/modern/index-cursor-1-expected.txt [new file with mode: 0644]
LayoutTests/storage/indexeddb/modern/index-cursor-1.html [new file with mode: 0644]
LayoutTests/storage/indexeddb/modern/index-cursor-2-expected.txt [new file with mode: 0644]
LayoutTests/storage/indexeddb/modern/index-cursor-2.html [new file with mode: 0644]
LayoutTests/storage/indexeddb/modern/index-cursor-3-expected.txt [new file with mode: 0644]
LayoutTests/storage/indexeddb/modern/index-cursor-3.html [new file with mode: 0644]
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/Modules/indexeddb/client/IDBIndexImpl.cpp
Source/WebCore/Modules/indexeddb/server/IndexValueEntry.cpp
Source/WebCore/Modules/indexeddb/server/IndexValueEntry.h
Source/WebCore/Modules/indexeddb/server/IndexValueStore.cpp
Source/WebCore/Modules/indexeddb/server/IndexValueStore.h
Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.cpp
Source/WebCore/Modules/indexeddb/server/MemoryIndex.cpp
Source/WebCore/Modules/indexeddb/server/MemoryIndex.h
Source/WebCore/Modules/indexeddb/server/MemoryIndexCursor.cpp [new file with mode: 0644]
Source/WebCore/Modules/indexeddb/server/MemoryIndexCursor.h [new file with mode: 0644]
Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.cpp
Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.h
Source/WebCore/Modules/indexeddb/shared/IDBCursorInfo.cpp
Source/WebCore/Modules/indexeddb/shared/IDBCursorInfo.h
Source/WebCore/WebCore.xcodeproj/project.pbxproj