12015-11-12 Brady Eidson <beidson@apple.com>
2
3 Modern IDB: Pipe through cursor functions from client to server.
4 https://bugs.webkit.org/show_bug.cgi?id=151197
5
6 Reviewed by NOBODY (OOPS!).
7
8 Tests: storage/indexeddb/modern/cursor-1.html
9 storage/indexeddb/modern/opencursor-failures.html
10
11 This patch implements most IDBCursor considerations at the IDL level, as well as pipes the
12 appropriate messages through from client to server.
13
14 All operations currently end in errors. Bug 151196 will fix that by making cursors functional.
15
16 * CMakeLists.txt:
17 * WebCore.xcodeproj/project.pbxproj:
18
19 * Modules/indexeddb/IDBCursor.h:
20 (WebCore::IDBCursor::isKeyCursor): Deleted.
21 * Modules/indexeddb/IDBCursorWithValue.h:
22
23 * Modules/indexeddb/IDBGetResult.h:
24
25 * Modules/indexeddb/IDBKeyData.h:
26 (WebCore::IDBKeyData::string):
27 (WebCore::IDBKeyData::date):
28 (WebCore::IDBKeyData::number):
29 (WebCore::IDBKeyData::array):
30
31 * Modules/indexeddb/IndexedDB.h:
32
33 * Modules/indexeddb/client/IDBAnyImpl.cpp:
34 (WebCore::IDBClient::IDBAny::IDBAny):
35 (WebCore::IDBClient::IDBAny::idbCursor):
36 (WebCore::IDBClient::IDBAny::idbCursorWithValue):
37 (WebCore::IDBClient::IDBAny::idbIndex):
38 (WebCore::IDBClient::IDBAny::idbObjectStore):
39 (WebCore::IDBClient::IDBAny::modernIDBCursor):
40 * Modules/indexeddb/client/IDBAnyImpl.h:
41 (WebCore::IDBClient::IDBAny::create):
42
43 * Modules/indexeddb/client/IDBConnectionToServer.cpp:
44 (WebCore::IDBClient::IDBConnectionToServer::openCursor):
45 (WebCore::IDBClient::IDBConnectionToServer::didOpenCursor):
46 (WebCore::IDBClient::IDBConnectionToServer::iterateCursor):
47 (WebCore::IDBClient::IDBConnectionToServer::didIterateCursor):
48 * Modules/indexeddb/client/IDBConnectionToServer.h:
49 * Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
50
51 * Modules/indexeddb/client/IDBCursorImpl.cpp:
52 (WebCore::IDBClient::IDBCursor::create):
53 (WebCore::IDBClient::IDBCursor::IDBCursor):
54 (WebCore::IDBClient::IDBCursor::sourcesDeleted):
55 (WebCore::IDBClient::IDBCursor::effectiveObjectStore):
56 (WebCore::IDBClient::IDBCursor::transaction):
57 (WebCore::IDBClient::IDBCursor::direction):
58 (WebCore::IDBClient::IDBCursor::key):
59 (WebCore::IDBClient::IDBCursor::primaryKey):
60 (WebCore::IDBClient::IDBCursor::value):
61 (WebCore::IDBClient::IDBCursor::source):
62 (WebCore::IDBClient::IDBCursor::update):
63 (WebCore::IDBClient::IDBCursor::advance):
64 (WebCore::IDBClient::IDBCursor::continueFunction):
65 (WebCore::IDBClient::IDBCursor::uncheckedIteratorCursor):
66 (WebCore::IDBClient::IDBCursor::deleteFunction):
67 (WebCore::IDBClient::IDBCursor::setGetResult):
68 * Modules/indexeddb/client/IDBCursorImpl.h:
69 (WebCore::IDBClient::IDBCursor::info):
70 (WebCore::IDBClient::IDBCursor::setRequest):
71 (WebCore::IDBClient::IDBCursor::clearRequest):
72 (WebCore::IDBClient::IDBCursor::request):
73
74 * Modules/indexeddb/client/IDBCursorWithValueImpl.cpp:
75 (WebCore::IDBClient::IDBCursorWithValue::create):
76 (WebCore::IDBClient::IDBCursorWithValue::IDBCursorWithValue):
77 (WebCore::IDBClient::IDBCursorWithValue::~IDBCursorWithValue):
78 * Modules/indexeddb/client/IDBCursorWithValueImpl.h:
79
80 * Modules/indexeddb/client/IDBIndexImpl.cpp:
81 (WebCore::IDBClient::IDBIndex::openCursor):
82 (WebCore::IDBClient::IDBIndex::openKeyCursor):
83 * Modules/indexeddb/client/IDBIndexImpl.h:
84 (WebCore::IDBClient::IDBIndex::modernObjectStore):
85 (WebCore::IDBClient::IDBIndex::isDeleted):
86
87 * Modules/indexeddb/client/IDBObjectStoreImpl.cpp:
88 (WebCore::IDBClient::IDBObjectStore::openCursor):
89 (WebCore::IDBClient::IDBObjectStore::deleteFunction):
90 * Modules/indexeddb/client/IDBObjectStoreImpl.h:
91
92 * Modules/indexeddb/client/IDBRequestImpl.cpp:
93 (WebCore::IDBClient::IDBRequest::create):
94 (WebCore::IDBClient::IDBRequest::IDBRequest):
95 (WebCore::IDBClient::IDBRequest::~IDBRequest):
96 (WebCore::IDBClient::IDBRequest::source):
97 (WebCore::IDBClient::IDBRequest::resultCursor):
98 (WebCore::IDBClient::IDBRequest::willIterateCursor):
99 (WebCore::IDBClient::IDBRequest::didOpenOrIterateCursor):
100 (WebCore::IDBClient::IDBRequest::requestCompleted):
101 * Modules/indexeddb/client/IDBRequestImpl.h:
102 (WebCore::IDBClient::IDBRequest::modernResult):
103
104 * Modules/indexeddb/client/IDBTransactionImpl.cpp:
105 (WebCore::IDBClient::IDBTransaction::requestOpenCursor):
106 (WebCore::IDBClient::IDBTransaction::doRequestOpenCursor):
107 (WebCore::IDBClient::IDBTransaction::openCursorOnServer):
108 (WebCore::IDBClient::IDBTransaction::didOpenCursorOnServer):
109 (WebCore::IDBClient::IDBTransaction::iterateCursor):
110 (WebCore::IDBClient::IDBTransaction::iterateCursorOnServer):
111 (WebCore::IDBClient::IDBTransaction::didIterateCursorOnServer):
112 * Modules/indexeddb/client/IDBTransactionImpl.h:
113
114 * Modules/indexeddb/client/TransactionOperation.h:
115 (WebCore::IDBClient::createTransactionOperation):
116
117 * Modules/indexeddb/legacy/LegacyCursor.cpp:
118 (WebCore::LegacyCursor::source):
119 * Modules/indexeddb/legacy/LegacyCursor.h:
120 (WebCore::LegacyCursor::continueFunction): Deleted.
121 (WebCore::LegacyCursor::isKeyCursor): Deleted.
122 * Modules/indexeddb/legacy/LegacyCursorWithValue.h:
123
124 * Modules/indexeddb/server/IDBBackingStore.h:
125
126 * Modules/indexeddb/server/IDBConnectionToClient.cpp:
127 (WebCore::IDBServer::IDBConnectionToClient::didOpenCursor):
128 (WebCore::IDBServer::IDBConnectionToClient::didIterateCursor):
129 * Modules/indexeddb/server/IDBConnectionToClient.h:
130 * Modules/indexeddb/server/IDBConnectionToClientDelegate.h:
131
132 * Modules/indexeddb/server/IDBServer.cpp:
133 (WebCore::IDBServer::IDBServer::openCursor):
134 (WebCore::IDBServer::IDBServer::iterateCursor):
135 * Modules/indexeddb/server/IDBServer.h:
136
137 * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
138 (WebCore::IDBServer::MemoryIDBBackingStore::openCursor):
139 (WebCore::IDBServer::MemoryIDBBackingStore::iterateCursor):
140 * Modules/indexeddb/server/MemoryIDBBackingStore.h:
141
142 * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
143 (WebCore::IDBServer::UniqueIDBDatabase::openCursor):
144 (WebCore::IDBServer::UniqueIDBDatabase::performOpenCursor):
145 (WebCore::IDBServer::UniqueIDBDatabase::didPerformOpenCursor):
146 (WebCore::IDBServer::UniqueIDBDatabase::iterateCursor):
147 (WebCore::IDBServer::UniqueIDBDatabase::performIterateCursor):
148 (WebCore::IDBServer::UniqueIDBDatabase::didPerformIterateCursor):
149 * Modules/indexeddb/server/UniqueIDBDatabase.h:
150
151 * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
152 (WebCore::IDBServer::UniqueIDBDatabaseTransaction::deleteRecord):
153 (WebCore::IDBServer::UniqueIDBDatabaseTransaction::openCursor):
154 (WebCore::IDBServer::UniqueIDBDatabaseTransaction::iterateCursor):
155 * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
156
157 * Modules/indexeddb/shared/IDBCursorInfo.cpp: Added.
158 (WebCore::IDBCursorInfo::objectStoreCursor):
159 (WebCore::IDBCursorInfo::indexCursor):
160 (WebCore::IDBCursorInfo::IDBCursorInfo):
161 (WebCore::IDBCursorInfo::isDirectionForward):
162 (WebCore::IDBCursorInfo::isolatedCopy):
163 * Modules/indexeddb/shared/IDBCursorInfo.h: Added.
164 (WebCore::IDBCursorInfo::identifier):
165 (WebCore::IDBCursorInfo::sourceIdentifier):
166 (WebCore::IDBCursorInfo::cursorSource):
167 (WebCore::IDBCursorInfo::cursorDirection):
168 (WebCore::IDBCursorInfo::cursorType):
169
170 * Modules/indexeddb/shared/IDBResultData.cpp:
171 (WebCore::IDBResultData::openCursorSuccess):
172 (WebCore::IDBResultData::iterateCursorSuccess):
173 * Modules/indexeddb/shared/IDBResultData.h:
174
175 * Modules/indexeddb/shared/InProcessIDBServer.cpp:
176 (WebCore::InProcessIDBServer::didOpenCursor):
177 (WebCore::InProcessIDBServer::didIterateCursor):
178 (WebCore::InProcessIDBServer::openCursor):
179 (WebCore::InProcessIDBServer::iterateCursor):
180 * Modules/indexeddb/shared/InProcessIDBServer.h:
181
182 * bindings/js/IDBBindingUtilities.cpp:
183 (WebCore::idbKeyDataToJSValue):
184 * bindings/js/IDBBindingUtilities.h:
185
186 * platform/CrossThreadCopier.cpp:
187 (WebCore::IDBCursorInfo>::copy):
188 * platform/CrossThreadCopier.h:
189