Modern IDB: Pipe through cursor functions from client to server.
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 13 Nov 2015 00:24:11 +0000 (00:24 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 13 Nov 2015 00:24:11 +0000 (00:24 +0000)
commit1726a55b4abaf53beaa357ef6f69497da6dd91ec
treeecae7cdcdf6e71a743541d26eb2ede8882594164
parent7f2eb3c6515bb43e3bfcd5c09b38a55e9364520a
Modern IDB: Pipe through cursor functions from client to server.
https://bugs.webkit.org/show_bug.cgi?id=151197

Reviewed by Alex Christensen.

Source/WebCore:

Tests: storage/indexeddb/modern/cursor-1.html
       storage/indexeddb/modern/opencursor-failures.html

This patch implements most IDBCursor considerations at the IDL level, as well as pipes the
appropriate messages through from client to server.

All operations currently end in errors. Bug 151196 will fix that by making cursors functional.

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

* Modules/indexeddb/IDBCursor.h:
(WebCore::IDBCursor::isKeyCursor): Deleted.
* Modules/indexeddb/IDBCursorWithValue.h:

* Modules/indexeddb/IDBGetResult.h:

* Modules/indexeddb/IDBKeyData.h:
(WebCore::IDBKeyData::string):
(WebCore::IDBKeyData::date):
(WebCore::IDBKeyData::number):
(WebCore::IDBKeyData::array):

* Modules/indexeddb/IndexedDB.h:

* Modules/indexeddb/client/IDBAnyImpl.cpp:
(WebCore::IDBClient::IDBAny::IDBAny):
(WebCore::IDBClient::IDBAny::idbCursor):
(WebCore::IDBClient::IDBAny::idbCursorWithValue):
(WebCore::IDBClient::IDBAny::idbIndex):
(WebCore::IDBClient::IDBAny::idbObjectStore):
(WebCore::IDBClient::IDBAny::modernIDBCursor):
* Modules/indexeddb/client/IDBAnyImpl.h:
(WebCore::IDBClient::IDBAny::create):

* Modules/indexeddb/client/IDBConnectionToServer.cpp:
(WebCore::IDBClient::IDBConnectionToServer::openCursor):
(WebCore::IDBClient::IDBConnectionToServer::didOpenCursor):
(WebCore::IDBClient::IDBConnectionToServer::iterateCursor):
(WebCore::IDBClient::IDBConnectionToServer::didIterateCursor):
* Modules/indexeddb/client/IDBConnectionToServer.h:
* Modules/indexeddb/client/IDBConnectionToServerDelegate.h:

* Modules/indexeddb/client/IDBCursorImpl.cpp:
(WebCore::IDBClient::IDBCursor::create):
(WebCore::IDBClient::IDBCursor::IDBCursor):
(WebCore::IDBClient::IDBCursor::sourcesDeleted):
(WebCore::IDBClient::IDBCursor::effectiveObjectStore):
(WebCore::IDBClient::IDBCursor::transaction):
(WebCore::IDBClient::IDBCursor::direction):
(WebCore::IDBClient::IDBCursor::key):
(WebCore::IDBClient::IDBCursor::primaryKey):
(WebCore::IDBClient::IDBCursor::value):
(WebCore::IDBClient::IDBCursor::source):
(WebCore::IDBClient::IDBCursor::update):
(WebCore::IDBClient::IDBCursor::advance):
(WebCore::IDBClient::IDBCursor::continueFunction):
(WebCore::IDBClient::IDBCursor::uncheckedIteratorCursor):
(WebCore::IDBClient::IDBCursor::deleteFunction):
(WebCore::IDBClient::IDBCursor::setGetResult):
* Modules/indexeddb/client/IDBCursorImpl.h:
(WebCore::IDBClient::IDBCursor::info):
(WebCore::IDBClient::IDBCursor::setRequest):
(WebCore::IDBClient::IDBCursor::clearRequest):
(WebCore::IDBClient::IDBCursor::request):

* Modules/indexeddb/client/IDBCursorWithValueImpl.cpp:
(WebCore::IDBClient::IDBCursorWithValue::create):
(WebCore::IDBClient::IDBCursorWithValue::IDBCursorWithValue):
(WebCore::IDBClient::IDBCursorWithValue::~IDBCursorWithValue):
* Modules/indexeddb/client/IDBCursorWithValueImpl.h:

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

* Modules/indexeddb/client/IDBObjectStoreImpl.cpp:
(WebCore::IDBClient::IDBObjectStore::openCursor):
(WebCore::IDBClient::IDBObjectStore::deleteFunction):
* Modules/indexeddb/client/IDBObjectStoreImpl.h:

* Modules/indexeddb/client/IDBRequestImpl.cpp:
(WebCore::IDBClient::IDBRequest::create):
(WebCore::IDBClient::IDBRequest::IDBRequest):
(WebCore::IDBClient::IDBRequest::~IDBRequest):
(WebCore::IDBClient::IDBRequest::source):
(WebCore::IDBClient::IDBRequest::resultCursor):
(WebCore::IDBClient::IDBRequest::willIterateCursor):
(WebCore::IDBClient::IDBRequest::didOpenOrIterateCursor):
(WebCore::IDBClient::IDBRequest::requestCompleted):
* Modules/indexeddb/client/IDBRequestImpl.h:
(WebCore::IDBClient::IDBRequest::modernResult):

* Modules/indexeddb/client/IDBTransactionImpl.cpp:
(WebCore::IDBClient::IDBTransaction::requestOpenCursor):
(WebCore::IDBClient::IDBTransaction::doRequestOpenCursor):
(WebCore::IDBClient::IDBTransaction::openCursorOnServer):
(WebCore::IDBClient::IDBTransaction::didOpenCursorOnServer):
(WebCore::IDBClient::IDBTransaction::iterateCursor):
(WebCore::IDBClient::IDBTransaction::iterateCursorOnServer):
(WebCore::IDBClient::IDBTransaction::didIterateCursorOnServer):
* Modules/indexeddb/client/IDBTransactionImpl.h:

* Modules/indexeddb/client/TransactionOperation.h:
(WebCore::IDBClient::createTransactionOperation):

* Modules/indexeddb/legacy/LegacyCursor.cpp:
(WebCore::LegacyCursor::source):
* Modules/indexeddb/legacy/LegacyCursor.h:
(WebCore::LegacyCursor::continueFunction): Deleted.
(WebCore::LegacyCursor::isKeyCursor): Deleted.
* Modules/indexeddb/legacy/LegacyCursorWithValue.h:

* Modules/indexeddb/server/IDBBackingStore.h:

* Modules/indexeddb/server/IDBConnectionToClient.cpp:
(WebCore::IDBServer::IDBConnectionToClient::didOpenCursor):
(WebCore::IDBServer::IDBConnectionToClient::didIterateCursor):
* Modules/indexeddb/server/IDBConnectionToClient.h:
* Modules/indexeddb/server/IDBConnectionToClientDelegate.h:

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

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

* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::openCursor):
(WebCore::IDBServer::UniqueIDBDatabase::performOpenCursor):
(WebCore::IDBServer::UniqueIDBDatabase::didPerformOpenCursor):
(WebCore::IDBServer::UniqueIDBDatabase::iterateCursor):
(WebCore::IDBServer::UniqueIDBDatabase::performIterateCursor):
(WebCore::IDBServer::UniqueIDBDatabase::didPerformIterateCursor):
* Modules/indexeddb/server/UniqueIDBDatabase.h:

* Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::deleteRecord):
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::openCursor):
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::iterateCursor):
* Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:

* Modules/indexeddb/shared/IDBCursorInfo.cpp: Added.
(WebCore::IDBCursorInfo::objectStoreCursor):
(WebCore::IDBCursorInfo::indexCursor):
(WebCore::IDBCursorInfo::IDBCursorInfo):
(WebCore::IDBCursorInfo::isDirectionForward):
(WebCore::IDBCursorInfo::isolatedCopy):
* Modules/indexeddb/shared/IDBCursorInfo.h: Added.
(WebCore::IDBCursorInfo::identifier):
(WebCore::IDBCursorInfo::sourceIdentifier):
(WebCore::IDBCursorInfo::cursorSource):
(WebCore::IDBCursorInfo::cursorDirection):
(WebCore::IDBCursorInfo::cursorType):

* Modules/indexeddb/shared/IDBResultData.cpp:
(WebCore::IDBResultData::openCursorSuccess):
(WebCore::IDBResultData::iterateCursorSuccess):
* Modules/indexeddb/shared/IDBResultData.h:

* Modules/indexeddb/shared/InProcessIDBServer.cpp:
(WebCore::InProcessIDBServer::didOpenCursor):
(WebCore::InProcessIDBServer::didIterateCursor):
(WebCore::InProcessIDBServer::openCursor):
(WebCore::InProcessIDBServer::iterateCursor):
* Modules/indexeddb/shared/InProcessIDBServer.h:

* bindings/js/IDBBindingUtilities.cpp:
(WebCore::idbKeyDataToJSValue):
* bindings/js/IDBBindingUtilities.h:

* platform/CrossThreadCopier.cpp:
(WebCore::IDBCursorInfo>::copy):
* platform/CrossThreadCopier.h:

LayoutTests:

* storage/indexeddb/modern/cursor-1-expected.txt: Added.
* storage/indexeddb/modern/cursor-1.html: Added.
* storage/indexeddb/modern/opencursor-failures-expected.txt: Added.
* storage/indexeddb/modern/opencursor-failures.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@192396 268f45cc-cd09-0410-ab3c-d52691b4dbfc
56 files changed:
LayoutTests/ChangeLog
LayoutTests/storage/indexeddb/modern/cursor-1-expected.txt [new file with mode: 0644]
LayoutTests/storage/indexeddb/modern/cursor-1.html [new file with mode: 0644]
LayoutTests/storage/indexeddb/modern/opencursor-failures-expected.txt [new file with mode: 0644]
LayoutTests/storage/indexeddb/modern/opencursor-failures.html [new file with mode: 0644]
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/Modules/indexeddb/IDBCursor.h
Source/WebCore/Modules/indexeddb/IDBCursorWithValue.h
Source/WebCore/Modules/indexeddb/IDBGetResult.h
Source/WebCore/Modules/indexeddb/IDBKeyData.h
Source/WebCore/Modules/indexeddb/IndexedDB.h
Source/WebCore/Modules/indexeddb/client/IDBAnyImpl.cpp
Source/WebCore/Modules/indexeddb/client/IDBAnyImpl.h
Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.cpp
Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.h
Source/WebCore/Modules/indexeddb/client/IDBConnectionToServerDelegate.h
Source/WebCore/Modules/indexeddb/client/IDBCursorImpl.cpp
Source/WebCore/Modules/indexeddb/client/IDBCursorImpl.h
Source/WebCore/Modules/indexeddb/client/IDBCursorWithValueImpl.cpp
Source/WebCore/Modules/indexeddb/client/IDBCursorWithValueImpl.h
Source/WebCore/Modules/indexeddb/client/IDBIndexImpl.cpp
Source/WebCore/Modules/indexeddb/client/IDBIndexImpl.h
Source/WebCore/Modules/indexeddb/client/IDBObjectStoreImpl.cpp
Source/WebCore/Modules/indexeddb/client/IDBObjectStoreImpl.h
Source/WebCore/Modules/indexeddb/client/IDBRequestImpl.cpp
Source/WebCore/Modules/indexeddb/client/IDBRequestImpl.h
Source/WebCore/Modules/indexeddb/client/IDBTransactionImpl.cpp
Source/WebCore/Modules/indexeddb/client/IDBTransactionImpl.h
Source/WebCore/Modules/indexeddb/client/TransactionOperation.h
Source/WebCore/Modules/indexeddb/legacy/LegacyCursor.cpp
Source/WebCore/Modules/indexeddb/legacy/LegacyCursor.h
Source/WebCore/Modules/indexeddb/legacy/LegacyCursorWithValue.h
Source/WebCore/Modules/indexeddb/server/IDBBackingStore.h
Source/WebCore/Modules/indexeddb/server/IDBConnectionToClient.cpp
Source/WebCore/Modules/indexeddb/server/IDBConnectionToClient.h
Source/WebCore/Modules/indexeddb/server/IDBConnectionToClientDelegate.h
Source/WebCore/Modules/indexeddb/server/IDBServer.cpp
Source/WebCore/Modules/indexeddb/server/IDBServer.h
Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.cpp
Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.h
Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp
Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.h
Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp
Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h
Source/WebCore/Modules/indexeddb/shared/IDBCursorInfo.cpp [new file with mode: 0644]
Source/WebCore/Modules/indexeddb/shared/IDBCursorInfo.h [new file with mode: 0644]
Source/WebCore/Modules/indexeddb/shared/IDBResultData.cpp
Source/WebCore/Modules/indexeddb/shared/IDBResultData.h
Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.cpp
Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.h
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/bindings/js/IDBBindingUtilities.cpp
Source/WebCore/bindings/js/IDBBindingUtilities.h
Source/WebCore/platform/CrossThreadCopier.cpp
Source/WebCore/platform/CrossThreadCopier.h