IndexedDB 2.0: Support IDBObjectStore openKeyCursor.
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 25 Oct 2016 21:42:57 +0000 (21:42 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 25 Oct 2016 21:42:57 +0000 (21:42 +0000)
commitd10c3ad88ff121b48322ec895e3aadc3b05c5094
treec7a4964473f398b995b45aecefcdbbb6a1a918b0
parentc9090858d6cbdbd85d9414619f210230d62df5c7
IndexedDB 2.0: Support IDBObjectStore openKeyCursor.
<rdar://problem/28806930> and https://bugs.webkit.org/show_bug.cgi?id=163954

Reviewed by Andy Estes.

LayoutTests/imported/w3c:

* web-platform-tests/IndexedDB/idbobjectstore_openKeyCursor-expected.txt:

Source/WebCore:

No new tests (Covered by changes to existing tests)

* Modules/indexeddb/IDBCursor.cpp:
(WebCore::IDBCursor::create):
* Modules/indexeddb/IDBCursor.h:

* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::openCursor):
(WebCore::IDBObjectStore::openKeyCursor):
* Modules/indexeddb/IDBObjectStore.h:
* Modules/indexeddb/IDBObjectStore.idl:

* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::requestOpenCursor):

* Modules/indexeddb/server/MemoryObjectStoreCursor.cpp:
(WebCore::IDBServer::MemoryObjectStoreCursor::currentData): Only grab the current value
  if the cursor is KeyAndValue.

* Modules/indexeddb/server/SQLiteIDBCursor.cpp:
(WebCore::IDBServer::SQLiteIDBCursor::SQLiteIDBCursor):
(WebCore::IDBServer::SQLiteIDBCursor::internalAdvanceOnce): Only save off the data for an
  object store cursor if it's both KeyAndValue.
* Modules/indexeddb/server/SQLiteIDBCursor.h:

* Modules/indexeddb/shared/IDBCursorInfo.cpp:
(WebCore::IDBCursorInfo::objectStoreCursor): Allow for a KeyOnly ObjectStoreCursor.
* Modules/indexeddb/shared/IDBCursorInfo.h:

LayoutTests:

* storage/indexeddb/modern/cursor-1-expected.txt:
* storage/indexeddb/modern/cursor-1-private-expected.txt:
* storage/indexeddb/modern/resources/cursor-1.js:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207845 268f45cc-cd09-0410-ab3c-d52691b4dbfc
18 files changed:
LayoutTests/ChangeLog
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbobjectstore_openKeyCursor-expected.txt
LayoutTests/storage/indexeddb/modern/cursor-1-expected.txt
LayoutTests/storage/indexeddb/modern/cursor-1-private-expected.txt
LayoutTests/storage/indexeddb/modern/resources/cursor-1.js
Source/WebCore/ChangeLog
Source/WebCore/Modules/indexeddb/IDBCursor.cpp
Source/WebCore/Modules/indexeddb/IDBCursor.h
Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp
Source/WebCore/Modules/indexeddb/IDBObjectStore.h
Source/WebCore/Modules/indexeddb/IDBObjectStore.idl
Source/WebCore/Modules/indexeddb/IDBTransaction.cpp
Source/WebCore/Modules/indexeddb/server/MemoryObjectStoreCursor.cpp
Source/WebCore/Modules/indexeddb/server/SQLiteIDBCursor.cpp
Source/WebCore/Modules/indexeddb/server/SQLiteIDBCursor.h
Source/WebCore/Modules/indexeddb/shared/IDBCursorInfo.cpp
Source/WebCore/Modules/indexeddb/shared/IDBCursorInfo.h