haikuwebkit/LayoutTests/storage/indexeddb/lazy-index-population-expec...

82 lines
2.5 KiB
Plaintext
Raw Permalink Normal View History

IndexedDB: generate index keys for existing data in createIndex in front end https://bugs.webkit.org/show_bug.cgi?id=91125 Patch by Alec Flett <alecflett@chromium.org> on 2012-08-15 Reviewed by Tony Chang. Source/WebCore: Make createIndex() do index key generation in the frontend, rather than the backend. When an index is created, the frontend uses the cursor API to iterate through the values in the backend to generate keys, sending them back to the backend using IDBObjectStore::setIndexKeys() This confines all key injection/extraction to the frontend. The new test verifies the implemented behavior with respect to error handling in degenerate uses of put(), though that behavior is still in discussion as the spec is vague on the proper error behavior. Test: storage/indexeddb/lazy-index-population.html * Modules/indexeddb/IDBCursorBackendImpl.cpp: Make sure that the TaskType propagates throught the cursor and all subsequent continue() calls. (WebCore::IDBCursorBackendImpl::IDBCursorBackendImpl): (WebCore::IDBCursorBackendImpl::continueFunction): (WebCore::IDBCursorBackendImpl::prefetchContinue): * Modules/indexeddb/IDBCursorBackendImpl.h: (WebCore::IDBCursorBackendImpl::create): (IDBCursorBackendImpl): * Modules/indexeddb/IDBObjectStore.cpp: Add an IndexPopulator class to run a cursor from the frontend. (WebCore): (WebCore::IDBObjectStore::createIndex): (WebCore::IDBObjectStore::openCursor): * Modules/indexeddb/IDBObjectStore.h: (WebCore::IDBObjectStore::openCursor): (IDBObjectStore): (WebCore::IDBObjectStore::createIndex): * Modules/indexeddb/IDBObjectStore.idl: Pass along ScriptContext so that openCursor can be called from createIndex. * Modules/indexeddb/IDBObjectStoreBackendImpl.cpp: (WebCore): (WebCore::makeIndexWriters): (WebCore::IDBObjectStoreBackendImpl::setIndexKeys): (WebCore::IDBObjectStoreBackendImpl::setIndexesReady): (WebCore::IDBObjectStoreBackendImpl::setIndexesReadyInternal): (WebCore::IDBObjectStoreBackendImpl::putInternal): (WebCore::IDBObjectStoreBackendImpl::deleteInternal): (WebCore::IDBObjectStoreBackendImpl::createIndexInternal): (WebCore::IDBObjectStoreBackendImpl::openCursor): (WebCore::IDBObjectStoreBackendImpl::openCursorInternal): * Modules/indexeddb/IDBObjectStoreBackendImpl.h: (IDBObjectStoreBackendImpl): (WebCore::IDBObjectStoreBackendImpl::iterIndexesBegin): (WebCore::IDBObjectStoreBackendImpl::iterIndexesEnd): (WebCore::IDBObjectStoreBackendImpl::backingStore): (WebCore::IDBObjectStoreBackendImpl::databaseId): * Modules/indexeddb/IDBObjectStoreBackendInterface.h: * Modules/indexeddb/IDBRequest.cpp: Allow requests to keep their own TaskType, to give certain requests priority over others. (WebCore::IDBRequest::create): (WebCore): (WebCore::IDBRequest::IDBRequest): (WebCore::IDBRequest::abort): * Modules/indexeddb/IDBRequest.h: (IDBRequest): (WebCore::IDBRequest::taskType): * Modules/indexeddb/IDBTransactionBackendImpl.cpp: Introduce a second, higher priority event queue, m_preemptiveTaskQueue, which takes priority over the regular task queue. (WebCore::IDBTransactionBackendImpl::IDBTransactionBackendImpl): (WebCore::IDBTransactionBackendImpl::scheduleTask): (WebCore::IDBTransactionBackendImpl::isTaskQueueEmpty): (WebCore): (WebCore::IDBTransactionBackendImpl::commit): (WebCore::IDBTransactionBackendImpl::taskTimerFired): (WebCore::IDBTransactionBackendImpl::taskEventTimerFired): * Modules/indexeddb/IDBTransactionBackendImpl.h: (WebCore::IDBTransactionBackendImpl::scheduleTask): (IDBTransactionBackendImpl): (WebCore::IDBTransactionBackendImpl::addEarlyEvent): (WebCore::IDBTransactionBackendImpl::didCompleteEarlyEvent): * Modules/indexeddb/IDBVersionChangeRequest.cpp: (WebCore::IDBVersionChangeRequest::IDBVersionChangeRequest): Source/WebKit/chromium: Add Chromium API methods to let the renderer process tell the browser process about indexing progress. * public/WebIDBObjectStore.h: (WebKit::WebIDBObjectStore::openCursor): * src/IDBObjectStoreBackendProxy.cpp: (WebKit::IDBObjectStoreBackendProxy::setIndexKeys): (WebKit): (WebKit::IDBObjectStoreBackendProxy::setIndexesReady): (WebKit::IDBObjectStoreBackendProxy::openCursor): * src/IDBObjectStoreBackendProxy.h: (IDBObjectStoreBackendProxy): * src/WebIDBObjectStoreImpl.cpp: (WebKit::WebIDBObjectStoreImpl::setIndexKeys): (WebKit): (WebKit::WebIDBObjectStoreImpl::setIndexesReady): (WebKit::WebIDBObjectStoreImpl::openCursor): * src/WebIDBObjectStoreImpl.h: (WebIDBObjectStoreImpl): LayoutTests: The transaction should be aborted when existing data in an objectStore causes uniqueness errors during index creation. * storage/indexeddb/lazy-index-population-expected.txt: Added. * storage/indexeddb/lazy-index-population.html: Added. Canonical link: https://commits.webkit.org/111986@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@125728 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-08-16 00:50:52 +00:00
Verify edge cases that lazy index population in an IndexedDB implementation might reveal.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
indexedDB = self.indexedDB || self.webkitIndexedDB || self.mozIndexedDB || self.msIndexedDB || self.OIndexedDB;
IndexedDB: Test conversions batch 4 https://bugs.webkit.org/show_bug.cgi?id=102267 Reviewed by Tony Chang. These are tests that don't have the js file in resources. The only interesting bit is that lazy-index-population uncovered a potential bug. I think tutorial.html has outlived its usefulness now that there are more tutorials on the web. It was very outdated. It is deleted in this patch. * storage/indexeddb/deletedatabase-transaction-expected.txt: * storage/indexeddb/deletedatabase-transaction.html: * storage/indexeddb/dont-commit-on-blocked-expected.txt: * storage/indexeddb/dont-commit-on-blocked.html: * storage/indexeddb/lazy-index-population-expected.txt: * storage/indexeddb/lazy-index-population.html: * storage/indexeddb/mozilla/index-prev-no-duplicate-expected.txt: * storage/indexeddb/mozilla/index-prev-no-duplicate.html: * storage/indexeddb/mozilla/resources/object-identity.js: Test added here to replace test covered in tutorial.html * storage/indexeddb/noblobs-expected.txt: * storage/indexeddb/noblobs.html: * storage/indexeddb/resources/dont-commit-on-blocked-worker.js: (onSetVersionSuccess): * storage/indexeddb/structured-clone-expected.txt: * storage/indexeddb/structured-clone.html: * storage/indexeddb/transaction-complete-with-js-recursion-cross-frame-expected.txt: * storage/indexeddb/transaction-complete-with-js-recursion-cross-frame.html: * storage/indexeddb/transaction-complete-with-js-recursion-expected.txt: * storage/indexeddb/transaction-complete-with-js-recursion.html: * storage/indexeddb/tutorial-expected.txt: Removed. * storage/indexeddb/tutorial.html: Removed. Canonical link: https://commits.webkit.org/120423@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@134700 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-11-15 01:19:01 +00:00
indexedDB.deleteDatabase(dbname)
indexedDB.open(dbname)
IndexedDB: generate index keys for existing data in createIndex in front end https://bugs.webkit.org/show_bug.cgi?id=91125 Patch by Alec Flett <alecflett@chromium.org> on 2012-08-15 Reviewed by Tony Chang. Source/WebCore: Make createIndex() do index key generation in the frontend, rather than the backend. When an index is created, the frontend uses the cursor API to iterate through the values in the backend to generate keys, sending them back to the backend using IDBObjectStore::setIndexKeys() This confines all key injection/extraction to the frontend. The new test verifies the implemented behavior with respect to error handling in degenerate uses of put(), though that behavior is still in discussion as the spec is vague on the proper error behavior. Test: storage/indexeddb/lazy-index-population.html * Modules/indexeddb/IDBCursorBackendImpl.cpp: Make sure that the TaskType propagates throught the cursor and all subsequent continue() calls. (WebCore::IDBCursorBackendImpl::IDBCursorBackendImpl): (WebCore::IDBCursorBackendImpl::continueFunction): (WebCore::IDBCursorBackendImpl::prefetchContinue): * Modules/indexeddb/IDBCursorBackendImpl.h: (WebCore::IDBCursorBackendImpl::create): (IDBCursorBackendImpl): * Modules/indexeddb/IDBObjectStore.cpp: Add an IndexPopulator class to run a cursor from the frontend. (WebCore): (WebCore::IDBObjectStore::createIndex): (WebCore::IDBObjectStore::openCursor): * Modules/indexeddb/IDBObjectStore.h: (WebCore::IDBObjectStore::openCursor): (IDBObjectStore): (WebCore::IDBObjectStore::createIndex): * Modules/indexeddb/IDBObjectStore.idl: Pass along ScriptContext so that openCursor can be called from createIndex. * Modules/indexeddb/IDBObjectStoreBackendImpl.cpp: (WebCore): (WebCore::makeIndexWriters): (WebCore::IDBObjectStoreBackendImpl::setIndexKeys): (WebCore::IDBObjectStoreBackendImpl::setIndexesReady): (WebCore::IDBObjectStoreBackendImpl::setIndexesReadyInternal): (WebCore::IDBObjectStoreBackendImpl::putInternal): (WebCore::IDBObjectStoreBackendImpl::deleteInternal): (WebCore::IDBObjectStoreBackendImpl::createIndexInternal): (WebCore::IDBObjectStoreBackendImpl::openCursor): (WebCore::IDBObjectStoreBackendImpl::openCursorInternal): * Modules/indexeddb/IDBObjectStoreBackendImpl.h: (IDBObjectStoreBackendImpl): (WebCore::IDBObjectStoreBackendImpl::iterIndexesBegin): (WebCore::IDBObjectStoreBackendImpl::iterIndexesEnd): (WebCore::IDBObjectStoreBackendImpl::backingStore): (WebCore::IDBObjectStoreBackendImpl::databaseId): * Modules/indexeddb/IDBObjectStoreBackendInterface.h: * Modules/indexeddb/IDBRequest.cpp: Allow requests to keep their own TaskType, to give certain requests priority over others. (WebCore::IDBRequest::create): (WebCore): (WebCore::IDBRequest::IDBRequest): (WebCore::IDBRequest::abort): * Modules/indexeddb/IDBRequest.h: (IDBRequest): (WebCore::IDBRequest::taskType): * Modules/indexeddb/IDBTransactionBackendImpl.cpp: Introduce a second, higher priority event queue, m_preemptiveTaskQueue, which takes priority over the regular task queue. (WebCore::IDBTransactionBackendImpl::IDBTransactionBackendImpl): (WebCore::IDBTransactionBackendImpl::scheduleTask): (WebCore::IDBTransactionBackendImpl::isTaskQueueEmpty): (WebCore): (WebCore::IDBTransactionBackendImpl::commit): (WebCore::IDBTransactionBackendImpl::taskTimerFired): (WebCore::IDBTransactionBackendImpl::taskEventTimerFired): * Modules/indexeddb/IDBTransactionBackendImpl.h: (WebCore::IDBTransactionBackendImpl::scheduleTask): (IDBTransactionBackendImpl): (WebCore::IDBTransactionBackendImpl::addEarlyEvent): (WebCore::IDBTransactionBackendImpl::didCompleteEarlyEvent): * Modules/indexeddb/IDBVersionChangeRequest.cpp: (WebCore::IDBVersionChangeRequest::IDBVersionChangeRequest): Source/WebKit/chromium: Add Chromium API methods to let the renderer process tell the browser process about indexing progress. * public/WebIDBObjectStore.h: (WebKit::WebIDBObjectStore::openCursor): * src/IDBObjectStoreBackendProxy.cpp: (WebKit::IDBObjectStoreBackendProxy::setIndexKeys): (WebKit): (WebKit::IDBObjectStoreBackendProxy::setIndexesReady): (WebKit::IDBObjectStoreBackendProxy::openCursor): * src/IDBObjectStoreBackendProxy.h: (IDBObjectStoreBackendProxy): * src/WebIDBObjectStoreImpl.cpp: (WebKit::WebIDBObjectStoreImpl::setIndexKeys): (WebKit): (WebKit::WebIDBObjectStoreImpl::setIndexesReady): (WebKit::WebIDBObjectStoreImpl::openCursor): * src/WebIDBObjectStoreImpl.h: (WebIDBObjectStoreImpl): LayoutTests: The transaction should be aborted when existing data in an objectStore causes uniqueness errors during index creation. * storage/indexeddb/lazy-index-population-expected.txt: Added. * storage/indexeddb/lazy-index-population.html: Added. Canonical link: https://commits.webkit.org/111986@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@125728 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-08-16 00:50:52 +00:00
Deleted all object stores.
store = connection.createObjectStore('store')
store.createIndex('index1', 'name', {unique: true})
IndexedDB: Test conversions batch 4 https://bugs.webkit.org/show_bug.cgi?id=102267 Reviewed by Tony Chang. These are tests that don't have the js file in resources. The only interesting bit is that lazy-index-population uncovered a potential bug. I think tutorial.html has outlived its usefulness now that there are more tutorials on the web. It was very outdated. It is deleted in this patch. * storage/indexeddb/deletedatabase-transaction-expected.txt: * storage/indexeddb/deletedatabase-transaction.html: * storage/indexeddb/dont-commit-on-blocked-expected.txt: * storage/indexeddb/dont-commit-on-blocked.html: * storage/indexeddb/lazy-index-population-expected.txt: * storage/indexeddb/lazy-index-population.html: * storage/indexeddb/mozilla/index-prev-no-duplicate-expected.txt: * storage/indexeddb/mozilla/index-prev-no-duplicate.html: * storage/indexeddb/mozilla/resources/object-identity.js: Test added here to replace test covered in tutorial.html * storage/indexeddb/noblobs-expected.txt: * storage/indexeddb/noblobs.html: * storage/indexeddb/resources/dont-commit-on-blocked-worker.js: (onSetVersionSuccess): * storage/indexeddb/structured-clone-expected.txt: * storage/indexeddb/structured-clone.html: * storage/indexeddb/transaction-complete-with-js-recursion-cross-frame-expected.txt: * storage/indexeddb/transaction-complete-with-js-recursion-cross-frame.html: * storage/indexeddb/transaction-complete-with-js-recursion-expected.txt: * storage/indexeddb/transaction-complete-with-js-recursion.html: * storage/indexeddb/tutorial-expected.txt: Removed. * storage/indexeddb/tutorial.html: Removed. Canonical link: https://commits.webkit.org/120423@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@134700 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-11-15 01:19:01 +00:00
Verify that uniqueness constraints are enforced with a pre-existing index:
IndexedDB: generate index keys for existing data in createIndex in front end https://bugs.webkit.org/show_bug.cgi?id=91125 Patch by Alec Flett <alecflett@chromium.org> on 2012-08-15 Reviewed by Tony Chang. Source/WebCore: Make createIndex() do index key generation in the frontend, rather than the backend. When an index is created, the frontend uses the cursor API to iterate through the values in the backend to generate keys, sending them back to the backend using IDBObjectStore::setIndexKeys() This confines all key injection/extraction to the frontend. The new test verifies the implemented behavior with respect to error handling in degenerate uses of put(), though that behavior is still in discussion as the spec is vague on the proper error behavior. Test: storage/indexeddb/lazy-index-population.html * Modules/indexeddb/IDBCursorBackendImpl.cpp: Make sure that the TaskType propagates throught the cursor and all subsequent continue() calls. (WebCore::IDBCursorBackendImpl::IDBCursorBackendImpl): (WebCore::IDBCursorBackendImpl::continueFunction): (WebCore::IDBCursorBackendImpl::prefetchContinue): * Modules/indexeddb/IDBCursorBackendImpl.h: (WebCore::IDBCursorBackendImpl::create): (IDBCursorBackendImpl): * Modules/indexeddb/IDBObjectStore.cpp: Add an IndexPopulator class to run a cursor from the frontend. (WebCore): (WebCore::IDBObjectStore::createIndex): (WebCore::IDBObjectStore::openCursor): * Modules/indexeddb/IDBObjectStore.h: (WebCore::IDBObjectStore::openCursor): (IDBObjectStore): (WebCore::IDBObjectStore::createIndex): * Modules/indexeddb/IDBObjectStore.idl: Pass along ScriptContext so that openCursor can be called from createIndex. * Modules/indexeddb/IDBObjectStoreBackendImpl.cpp: (WebCore): (WebCore::makeIndexWriters): (WebCore::IDBObjectStoreBackendImpl::setIndexKeys): (WebCore::IDBObjectStoreBackendImpl::setIndexesReady): (WebCore::IDBObjectStoreBackendImpl::setIndexesReadyInternal): (WebCore::IDBObjectStoreBackendImpl::putInternal): (WebCore::IDBObjectStoreBackendImpl::deleteInternal): (WebCore::IDBObjectStoreBackendImpl::createIndexInternal): (WebCore::IDBObjectStoreBackendImpl::openCursor): (WebCore::IDBObjectStoreBackendImpl::openCursorInternal): * Modules/indexeddb/IDBObjectStoreBackendImpl.h: (IDBObjectStoreBackendImpl): (WebCore::IDBObjectStoreBackendImpl::iterIndexesBegin): (WebCore::IDBObjectStoreBackendImpl::iterIndexesEnd): (WebCore::IDBObjectStoreBackendImpl::backingStore): (WebCore::IDBObjectStoreBackendImpl::databaseId): * Modules/indexeddb/IDBObjectStoreBackendInterface.h: * Modules/indexeddb/IDBRequest.cpp: Allow requests to keep their own TaskType, to give certain requests priority over others. (WebCore::IDBRequest::create): (WebCore): (WebCore::IDBRequest::IDBRequest): (WebCore::IDBRequest::abort): * Modules/indexeddb/IDBRequest.h: (IDBRequest): (WebCore::IDBRequest::taskType): * Modules/indexeddb/IDBTransactionBackendImpl.cpp: Introduce a second, higher priority event queue, m_preemptiveTaskQueue, which takes priority over the regular task queue. (WebCore::IDBTransactionBackendImpl::IDBTransactionBackendImpl): (WebCore::IDBTransactionBackendImpl::scheduleTask): (WebCore::IDBTransactionBackendImpl::isTaskQueueEmpty): (WebCore): (WebCore::IDBTransactionBackendImpl::commit): (WebCore::IDBTransactionBackendImpl::taskTimerFired): (WebCore::IDBTransactionBackendImpl::taskEventTimerFired): * Modules/indexeddb/IDBTransactionBackendImpl.h: (WebCore::IDBTransactionBackendImpl::scheduleTask): (IDBTransactionBackendImpl): (WebCore::IDBTransactionBackendImpl::addEarlyEvent): (WebCore::IDBTransactionBackendImpl::didCompleteEarlyEvent): * Modules/indexeddb/IDBVersionChangeRequest.cpp: (WebCore::IDBVersionChangeRequest::IDBVersionChangeRequest): Source/WebKit/chromium: Add Chromium API methods to let the renderer process tell the browser process about indexing progress. * public/WebIDBObjectStore.h: (WebKit::WebIDBObjectStore::openCursor): * src/IDBObjectStoreBackendProxy.cpp: (WebKit::IDBObjectStoreBackendProxy::setIndexKeys): (WebKit): (WebKit::IDBObjectStoreBackendProxy::setIndexesReady): (WebKit::IDBObjectStoreBackendProxy::openCursor): * src/IDBObjectStoreBackendProxy.h: (IDBObjectStoreBackendProxy): * src/WebIDBObjectStoreImpl.cpp: (WebKit::WebIDBObjectStoreImpl::setIndexKeys): (WebKit): (WebKit::WebIDBObjectStoreImpl::setIndexesReady): (WebKit::WebIDBObjectStoreImpl::openCursor): * src/WebIDBObjectStoreImpl.h: (WebIDBObjectStoreImpl): LayoutTests: The transaction should be aborted when existing data in an objectStore causes uniqueness errors during index creation. * storage/indexeddb/lazy-index-population-expected.txt: Added. * storage/indexeddb/lazy-index-population.html: Added. Canonical link: https://commits.webkit.org/111986@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@125728 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-08-16 00:50:52 +00:00
trans = connection.transaction('store', 'readwrite')
store = trans.objectStore('store')
request1 = store.put({name: 'bob'}, 1)
request2 = store.put({name: 'bob'}, 2)
state = 0
request1 received success event
PASS ++state is 1
request2 received error event
PASS ++state is 2
transaction aborted
PASS ++state is 3
IndexedDB: Pass type of error causing abort to IDBTransaction::onAbort https://bugs.webkit.org/show_bug.cgi?id=99097 Reviewed by Tony Chang. Source/WebCore: Include the error causing the abort in the callback from back end to front end so it can be exposed on the IDBTransaction.error property. Test: lazy-index-population.html * Modules/indexeddb/IDBDatabaseBackendImpl.cpp: (WebCore::IDBDatabaseBackendImpl::setVersionInternal): (WebCore::IDBDatabaseBackendImpl::setIntVersionInternal): * Modules/indexeddb/IDBDatabaseCallbacks.h: * Modules/indexeddb/IDBObjectStoreBackendImpl.cpp: (WebCore::IDBObjectStoreBackendImpl::setIndexKeys): (WebCore::IDBObjectStoreBackendImpl::putInternal): * Modules/indexeddb/IDBTransaction.cpp: (WebCore::IDBTransaction::onAbort): * Modules/indexeddb/IDBTransaction.h: (IDBTransaction): * Modules/indexeddb/IDBTransactionBackendImpl.cpp: (WebCore::IDBTransactionBackendImpl::abort): (WebCore): (WebCore::IDBTransactionBackendImpl::commit): * Modules/indexeddb/IDBTransactionBackendImpl.h: (IDBTransactionBackendImpl): * Modules/indexeddb/IDBTransactionCallbacks.h: (IDBTransactionCallbacks): * inspector/InspectorIndexedDBAgent.cpp: (WebCore): Source/WebKit/chromium: Plumbing to pass details about the cause of the transaction abort through to the front end. * public/WebIDBTransactionCallbacks.h: (WebKit): (WebKit::WebIDBTransactionCallbacks::onAbort): * src/IDBTransactionCallbacksProxy.cpp: (WebKit::IDBTransactionCallbacksProxy::onAbort): * src/IDBTransactionCallbacksProxy.h: (IDBTransactionCallbacksProxy): * src/WebIDBTransactionCallbacksImpl.cpp: (WebKit::WebIDBTransactionCallbacksImpl::onAbort): * src/WebIDBTransactionCallbacksImpl.h: (WebIDBTransactionCallbacksImpl): LayoutTests: Verify that IDBTransaction.error is reporting ConstraintError when indexing fails. * storage/indexeddb/lazy-index-population-expected.txt: * storage/indexeddb/lazy-index-population.html: Canonical link: https://commits.webkit.org/117336@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@131371 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-10-15 22:19:08 +00:00
PASS trans.error.name is 'ConstraintError'
IndexedDB: generate index keys for existing data in createIndex in front end https://bugs.webkit.org/show_bug.cgi?id=91125 Patch by Alec Flett <alecflett@chromium.org> on 2012-08-15 Reviewed by Tony Chang. Source/WebCore: Make createIndex() do index key generation in the frontend, rather than the backend. When an index is created, the frontend uses the cursor API to iterate through the values in the backend to generate keys, sending them back to the backend using IDBObjectStore::setIndexKeys() This confines all key injection/extraction to the frontend. The new test verifies the implemented behavior with respect to error handling in degenerate uses of put(), though that behavior is still in discussion as the spec is vague on the proper error behavior. Test: storage/indexeddb/lazy-index-population.html * Modules/indexeddb/IDBCursorBackendImpl.cpp: Make sure that the TaskType propagates throught the cursor and all subsequent continue() calls. (WebCore::IDBCursorBackendImpl::IDBCursorBackendImpl): (WebCore::IDBCursorBackendImpl::continueFunction): (WebCore::IDBCursorBackendImpl::prefetchContinue): * Modules/indexeddb/IDBCursorBackendImpl.h: (WebCore::IDBCursorBackendImpl::create): (IDBCursorBackendImpl): * Modules/indexeddb/IDBObjectStore.cpp: Add an IndexPopulator class to run a cursor from the frontend. (WebCore): (WebCore::IDBObjectStore::createIndex): (WebCore::IDBObjectStore::openCursor): * Modules/indexeddb/IDBObjectStore.h: (WebCore::IDBObjectStore::openCursor): (IDBObjectStore): (WebCore::IDBObjectStore::createIndex): * Modules/indexeddb/IDBObjectStore.idl: Pass along ScriptContext so that openCursor can be called from createIndex. * Modules/indexeddb/IDBObjectStoreBackendImpl.cpp: (WebCore): (WebCore::makeIndexWriters): (WebCore::IDBObjectStoreBackendImpl::setIndexKeys): (WebCore::IDBObjectStoreBackendImpl::setIndexesReady): (WebCore::IDBObjectStoreBackendImpl::setIndexesReadyInternal): (WebCore::IDBObjectStoreBackendImpl::putInternal): (WebCore::IDBObjectStoreBackendImpl::deleteInternal): (WebCore::IDBObjectStoreBackendImpl::createIndexInternal): (WebCore::IDBObjectStoreBackendImpl::openCursor): (WebCore::IDBObjectStoreBackendImpl::openCursorInternal): * Modules/indexeddb/IDBObjectStoreBackendImpl.h: (IDBObjectStoreBackendImpl): (WebCore::IDBObjectStoreBackendImpl::iterIndexesBegin): (WebCore::IDBObjectStoreBackendImpl::iterIndexesEnd): (WebCore::IDBObjectStoreBackendImpl::backingStore): (WebCore::IDBObjectStoreBackendImpl::databaseId): * Modules/indexeddb/IDBObjectStoreBackendInterface.h: * Modules/indexeddb/IDBRequest.cpp: Allow requests to keep their own TaskType, to give certain requests priority over others. (WebCore::IDBRequest::create): (WebCore): (WebCore::IDBRequest::IDBRequest): (WebCore::IDBRequest::abort): * Modules/indexeddb/IDBRequest.h: (IDBRequest): (WebCore::IDBRequest::taskType): * Modules/indexeddb/IDBTransactionBackendImpl.cpp: Introduce a second, higher priority event queue, m_preemptiveTaskQueue, which takes priority over the regular task queue. (WebCore::IDBTransactionBackendImpl::IDBTransactionBackendImpl): (WebCore::IDBTransactionBackendImpl::scheduleTask): (WebCore::IDBTransactionBackendImpl::isTaskQueueEmpty): (WebCore): (WebCore::IDBTransactionBackendImpl::commit): (WebCore::IDBTransactionBackendImpl::taskTimerFired): (WebCore::IDBTransactionBackendImpl::taskEventTimerFired): * Modules/indexeddb/IDBTransactionBackendImpl.h: (WebCore::IDBTransactionBackendImpl::scheduleTask): (IDBTransactionBackendImpl): (WebCore::IDBTransactionBackendImpl::addEarlyEvent): (WebCore::IDBTransactionBackendImpl::didCompleteEarlyEvent): * Modules/indexeddb/IDBVersionChangeRequest.cpp: (WebCore::IDBVersionChangeRequest::IDBVersionChangeRequest): Source/WebKit/chromium: Add Chromium API methods to let the renderer process tell the browser process about indexing progress. * public/WebIDBObjectStore.h: (WebKit::WebIDBObjectStore::openCursor): * src/IDBObjectStoreBackendProxy.cpp: (WebKit::IDBObjectStoreBackendProxy::setIndexKeys): (WebKit): (WebKit::IDBObjectStoreBackendProxy::setIndexesReady): (WebKit::IDBObjectStoreBackendProxy::openCursor): * src/IDBObjectStoreBackendProxy.h: (IDBObjectStoreBackendProxy): * src/WebIDBObjectStoreImpl.cpp: (WebKit::WebIDBObjectStoreImpl::setIndexKeys): (WebKit): (WebKit::WebIDBObjectStoreImpl::setIndexesReady): (WebKit::WebIDBObjectStoreImpl::openCursor): * src/WebIDBObjectStoreImpl.h: (WebIDBObjectStoreImpl): LayoutTests: The transaction should be aborted when existing data in an objectStore causes uniqueness errors during index creation. * storage/indexeddb/lazy-index-population-expected.txt: Added. * storage/indexeddb/lazy-index-population.html: Added. Canonical link: https://commits.webkit.org/111986@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@125728 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-08-16 00:50:52 +00:00
Verify that uniqueness constraints are enforced when index is created before puts:
IndexedDB: Test conversions batch 4 https://bugs.webkit.org/show_bug.cgi?id=102267 Reviewed by Tony Chang. These are tests that don't have the js file in resources. The only interesting bit is that lazy-index-population uncovered a potential bug. I think tutorial.html has outlived its usefulness now that there are more tutorials on the web. It was very outdated. It is deleted in this patch. * storage/indexeddb/deletedatabase-transaction-expected.txt: * storage/indexeddb/deletedatabase-transaction.html: * storage/indexeddb/dont-commit-on-blocked-expected.txt: * storage/indexeddb/dont-commit-on-blocked.html: * storage/indexeddb/lazy-index-population-expected.txt: * storage/indexeddb/lazy-index-population.html: * storage/indexeddb/mozilla/index-prev-no-duplicate-expected.txt: * storage/indexeddb/mozilla/index-prev-no-duplicate.html: * storage/indexeddb/mozilla/resources/object-identity.js: Test added here to replace test covered in tutorial.html * storage/indexeddb/noblobs-expected.txt: * storage/indexeddb/noblobs.html: * storage/indexeddb/resources/dont-commit-on-blocked-worker.js: (onSetVersionSuccess): * storage/indexeddb/structured-clone-expected.txt: * storage/indexeddb/structured-clone.html: * storage/indexeddb/transaction-complete-with-js-recursion-cross-frame-expected.txt: * storage/indexeddb/transaction-complete-with-js-recursion-cross-frame.html: * storage/indexeddb/transaction-complete-with-js-recursion-expected.txt: * storage/indexeddb/transaction-complete-with-js-recursion.html: * storage/indexeddb/tutorial-expected.txt: Removed. * storage/indexeddb/tutorial.html: Removed. Canonical link: https://commits.webkit.org/120423@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@134700 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-11-15 01:19:01 +00:00
connection.close()
indexedDB.open(dbname, 2)
IndexedDB: generate index keys for existing data in createIndex in front end https://bugs.webkit.org/show_bug.cgi?id=91125 Patch by Alec Flett <alecflett@chromium.org> on 2012-08-15 Reviewed by Tony Chang. Source/WebCore: Make createIndex() do index key generation in the frontend, rather than the backend. When an index is created, the frontend uses the cursor API to iterate through the values in the backend to generate keys, sending them back to the backend using IDBObjectStore::setIndexKeys() This confines all key injection/extraction to the frontend. The new test verifies the implemented behavior with respect to error handling in degenerate uses of put(), though that behavior is still in discussion as the spec is vague on the proper error behavior. Test: storage/indexeddb/lazy-index-population.html * Modules/indexeddb/IDBCursorBackendImpl.cpp: Make sure that the TaskType propagates throught the cursor and all subsequent continue() calls. (WebCore::IDBCursorBackendImpl::IDBCursorBackendImpl): (WebCore::IDBCursorBackendImpl::continueFunction): (WebCore::IDBCursorBackendImpl::prefetchContinue): * Modules/indexeddb/IDBCursorBackendImpl.h: (WebCore::IDBCursorBackendImpl::create): (IDBCursorBackendImpl): * Modules/indexeddb/IDBObjectStore.cpp: Add an IndexPopulator class to run a cursor from the frontend. (WebCore): (WebCore::IDBObjectStore::createIndex): (WebCore::IDBObjectStore::openCursor): * Modules/indexeddb/IDBObjectStore.h: (WebCore::IDBObjectStore::openCursor): (IDBObjectStore): (WebCore::IDBObjectStore::createIndex): * Modules/indexeddb/IDBObjectStore.idl: Pass along ScriptContext so that openCursor can be called from createIndex. * Modules/indexeddb/IDBObjectStoreBackendImpl.cpp: (WebCore): (WebCore::makeIndexWriters): (WebCore::IDBObjectStoreBackendImpl::setIndexKeys): (WebCore::IDBObjectStoreBackendImpl::setIndexesReady): (WebCore::IDBObjectStoreBackendImpl::setIndexesReadyInternal): (WebCore::IDBObjectStoreBackendImpl::putInternal): (WebCore::IDBObjectStoreBackendImpl::deleteInternal): (WebCore::IDBObjectStoreBackendImpl::createIndexInternal): (WebCore::IDBObjectStoreBackendImpl::openCursor): (WebCore::IDBObjectStoreBackendImpl::openCursorInternal): * Modules/indexeddb/IDBObjectStoreBackendImpl.h: (IDBObjectStoreBackendImpl): (WebCore::IDBObjectStoreBackendImpl::iterIndexesBegin): (WebCore::IDBObjectStoreBackendImpl::iterIndexesEnd): (WebCore::IDBObjectStoreBackendImpl::backingStore): (WebCore::IDBObjectStoreBackendImpl::databaseId): * Modules/indexeddb/IDBObjectStoreBackendInterface.h: * Modules/indexeddb/IDBRequest.cpp: Allow requests to keep their own TaskType, to give certain requests priority over others. (WebCore::IDBRequest::create): (WebCore): (WebCore::IDBRequest::IDBRequest): (WebCore::IDBRequest::abort): * Modules/indexeddb/IDBRequest.h: (IDBRequest): (WebCore::IDBRequest::taskType): * Modules/indexeddb/IDBTransactionBackendImpl.cpp: Introduce a second, higher priority event queue, m_preemptiveTaskQueue, which takes priority over the regular task queue. (WebCore::IDBTransactionBackendImpl::IDBTransactionBackendImpl): (WebCore::IDBTransactionBackendImpl::scheduleTask): (WebCore::IDBTransactionBackendImpl::isTaskQueueEmpty): (WebCore): (WebCore::IDBTransactionBackendImpl::commit): (WebCore::IDBTransactionBackendImpl::taskTimerFired): (WebCore::IDBTransactionBackendImpl::taskEventTimerFired): * Modules/indexeddb/IDBTransactionBackendImpl.h: (WebCore::IDBTransactionBackendImpl::scheduleTask): (IDBTransactionBackendImpl): (WebCore::IDBTransactionBackendImpl::addEarlyEvent): (WebCore::IDBTransactionBackendImpl::didCompleteEarlyEvent): * Modules/indexeddb/IDBVersionChangeRequest.cpp: (WebCore::IDBVersionChangeRequest::IDBVersionChangeRequest): Source/WebKit/chromium: Add Chromium API methods to let the renderer process tell the browser process about indexing progress. * public/WebIDBObjectStore.h: (WebKit::WebIDBObjectStore::openCursor): * src/IDBObjectStoreBackendProxy.cpp: (WebKit::IDBObjectStoreBackendProxy::setIndexKeys): (WebKit): (WebKit::IDBObjectStoreBackendProxy::setIndexesReady): (WebKit::IDBObjectStoreBackendProxy::openCursor): * src/IDBObjectStoreBackendProxy.h: (IDBObjectStoreBackendProxy): * src/WebIDBObjectStoreImpl.cpp: (WebKit::WebIDBObjectStoreImpl::setIndexKeys): (WebKit): (WebKit::WebIDBObjectStoreImpl::setIndexesReady): (WebKit::WebIDBObjectStoreImpl::openCursor): * src/WebIDBObjectStoreImpl.h: (WebIDBObjectStoreImpl): LayoutTests: The transaction should be aborted when existing data in an objectStore causes uniqueness errors during index creation. * storage/indexeddb/lazy-index-population-expected.txt: Added. * storage/indexeddb/lazy-index-population.html: Added. Canonical link: https://commits.webkit.org/111986@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@125728 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-08-16 00:50:52 +00:00
deleteAllObjectStores(connection)
Deleted all object stores.
store = connection.createObjectStore('store')
store.createIndex('index2', 'name', {unique: true})
request1 = store.put({name: 'carol'}, 1)
request2 = store.put({name: 'carol'}, 2)
state = 0
request1 (index2) received success event
PASS ++state is 1
request2 (index2) received error event
PASS ++state is 2
transaction aborted
PASS ++state is 3
IndexedDB: Pass type of error causing abort to IDBTransaction::onAbort https://bugs.webkit.org/show_bug.cgi?id=99097 Reviewed by Tony Chang. Source/WebCore: Include the error causing the abort in the callback from back end to front end so it can be exposed on the IDBTransaction.error property. Test: lazy-index-population.html * Modules/indexeddb/IDBDatabaseBackendImpl.cpp: (WebCore::IDBDatabaseBackendImpl::setVersionInternal): (WebCore::IDBDatabaseBackendImpl::setIntVersionInternal): * Modules/indexeddb/IDBDatabaseCallbacks.h: * Modules/indexeddb/IDBObjectStoreBackendImpl.cpp: (WebCore::IDBObjectStoreBackendImpl::setIndexKeys): (WebCore::IDBObjectStoreBackendImpl::putInternal): * Modules/indexeddb/IDBTransaction.cpp: (WebCore::IDBTransaction::onAbort): * Modules/indexeddb/IDBTransaction.h: (IDBTransaction): * Modules/indexeddb/IDBTransactionBackendImpl.cpp: (WebCore::IDBTransactionBackendImpl::abort): (WebCore): (WebCore::IDBTransactionBackendImpl::commit): * Modules/indexeddb/IDBTransactionBackendImpl.h: (IDBTransactionBackendImpl): * Modules/indexeddb/IDBTransactionCallbacks.h: (IDBTransactionCallbacks): * inspector/InspectorIndexedDBAgent.cpp: (WebCore): Source/WebKit/chromium: Plumbing to pass details about the cause of the transaction abort through to the front end. * public/WebIDBTransactionCallbacks.h: (WebKit): (WebKit::WebIDBTransactionCallbacks::onAbort): * src/IDBTransactionCallbacksProxy.cpp: (WebKit::IDBTransactionCallbacksProxy::onAbort): * src/IDBTransactionCallbacksProxy.h: (IDBTransactionCallbacksProxy): * src/WebIDBTransactionCallbacksImpl.cpp: (WebKit::WebIDBTransactionCallbacksImpl::onAbort): * src/WebIDBTransactionCallbacksImpl.h: (WebIDBTransactionCallbacksImpl): LayoutTests: Verify that IDBTransaction.error is reporting ConstraintError when indexing fails. * storage/indexeddb/lazy-index-population-expected.txt: * storage/indexeddb/lazy-index-population.html: Canonical link: https://commits.webkit.org/117336@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@131371 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-10-15 22:19:08 +00:00
PASS trans.error.name is 'ConstraintError'
IndexedDB: generate index keys for existing data in createIndex in front end https://bugs.webkit.org/show_bug.cgi?id=91125 Patch by Alec Flett <alecflett@chromium.org> on 2012-08-15 Reviewed by Tony Chang. Source/WebCore: Make createIndex() do index key generation in the frontend, rather than the backend. When an index is created, the frontend uses the cursor API to iterate through the values in the backend to generate keys, sending them back to the backend using IDBObjectStore::setIndexKeys() This confines all key injection/extraction to the frontend. The new test verifies the implemented behavior with respect to error handling in degenerate uses of put(), though that behavior is still in discussion as the spec is vague on the proper error behavior. Test: storage/indexeddb/lazy-index-population.html * Modules/indexeddb/IDBCursorBackendImpl.cpp: Make sure that the TaskType propagates throught the cursor and all subsequent continue() calls. (WebCore::IDBCursorBackendImpl::IDBCursorBackendImpl): (WebCore::IDBCursorBackendImpl::continueFunction): (WebCore::IDBCursorBackendImpl::prefetchContinue): * Modules/indexeddb/IDBCursorBackendImpl.h: (WebCore::IDBCursorBackendImpl::create): (IDBCursorBackendImpl): * Modules/indexeddb/IDBObjectStore.cpp: Add an IndexPopulator class to run a cursor from the frontend. (WebCore): (WebCore::IDBObjectStore::createIndex): (WebCore::IDBObjectStore::openCursor): * Modules/indexeddb/IDBObjectStore.h: (WebCore::IDBObjectStore::openCursor): (IDBObjectStore): (WebCore::IDBObjectStore::createIndex): * Modules/indexeddb/IDBObjectStore.idl: Pass along ScriptContext so that openCursor can be called from createIndex. * Modules/indexeddb/IDBObjectStoreBackendImpl.cpp: (WebCore): (WebCore::makeIndexWriters): (WebCore::IDBObjectStoreBackendImpl::setIndexKeys): (WebCore::IDBObjectStoreBackendImpl::setIndexesReady): (WebCore::IDBObjectStoreBackendImpl::setIndexesReadyInternal): (WebCore::IDBObjectStoreBackendImpl::putInternal): (WebCore::IDBObjectStoreBackendImpl::deleteInternal): (WebCore::IDBObjectStoreBackendImpl::createIndexInternal): (WebCore::IDBObjectStoreBackendImpl::openCursor): (WebCore::IDBObjectStoreBackendImpl::openCursorInternal): * Modules/indexeddb/IDBObjectStoreBackendImpl.h: (IDBObjectStoreBackendImpl): (WebCore::IDBObjectStoreBackendImpl::iterIndexesBegin): (WebCore::IDBObjectStoreBackendImpl::iterIndexesEnd): (WebCore::IDBObjectStoreBackendImpl::backingStore): (WebCore::IDBObjectStoreBackendImpl::databaseId): * Modules/indexeddb/IDBObjectStoreBackendInterface.h: * Modules/indexeddb/IDBRequest.cpp: Allow requests to keep their own TaskType, to give certain requests priority over others. (WebCore::IDBRequest::create): (WebCore): (WebCore::IDBRequest::IDBRequest): (WebCore::IDBRequest::abort): * Modules/indexeddb/IDBRequest.h: (IDBRequest): (WebCore::IDBRequest::taskType): * Modules/indexeddb/IDBTransactionBackendImpl.cpp: Introduce a second, higher priority event queue, m_preemptiveTaskQueue, which takes priority over the regular task queue. (WebCore::IDBTransactionBackendImpl::IDBTransactionBackendImpl): (WebCore::IDBTransactionBackendImpl::scheduleTask): (WebCore::IDBTransactionBackendImpl::isTaskQueueEmpty): (WebCore): (WebCore::IDBTransactionBackendImpl::commit): (WebCore::IDBTransactionBackendImpl::taskTimerFired): (WebCore::IDBTransactionBackendImpl::taskEventTimerFired): * Modules/indexeddb/IDBTransactionBackendImpl.h: (WebCore::IDBTransactionBackendImpl::scheduleTask): (IDBTransactionBackendImpl): (WebCore::IDBTransactionBackendImpl::addEarlyEvent): (WebCore::IDBTransactionBackendImpl::didCompleteEarlyEvent): * Modules/indexeddb/IDBVersionChangeRequest.cpp: (WebCore::IDBVersionChangeRequest::IDBVersionChangeRequest): Source/WebKit/chromium: Add Chromium API methods to let the renderer process tell the browser process about indexing progress. * public/WebIDBObjectStore.h: (WebKit::WebIDBObjectStore::openCursor): * src/IDBObjectStoreBackendProxy.cpp: (WebKit::IDBObjectStoreBackendProxy::setIndexKeys): (WebKit): (WebKit::IDBObjectStoreBackendProxy::setIndexesReady): (WebKit::IDBObjectStoreBackendProxy::openCursor): * src/IDBObjectStoreBackendProxy.h: (IDBObjectStoreBackendProxy): * src/WebIDBObjectStoreImpl.cpp: (WebKit::WebIDBObjectStoreImpl::setIndexKeys): (WebKit): (WebKit::WebIDBObjectStoreImpl::setIndexesReady): (WebKit::WebIDBObjectStoreImpl::openCursor): * src/WebIDBObjectStoreImpl.h: (WebIDBObjectStoreImpl): LayoutTests: The transaction should be aborted when existing data in an objectStore causes uniqueness errors during index creation. * storage/indexeddb/lazy-index-population-expected.txt: Added. * storage/indexeddb/lazy-index-population.html: Added. Canonical link: https://commits.webkit.org/111986@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@125728 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-08-16 00:50:52 +00:00
Verify that uniqueness constraints are enforced when index is created after puts:
IndexedDB: Test conversions batch 4 https://bugs.webkit.org/show_bug.cgi?id=102267 Reviewed by Tony Chang. These are tests that don't have the js file in resources. The only interesting bit is that lazy-index-population uncovered a potential bug. I think tutorial.html has outlived its usefulness now that there are more tutorials on the web. It was very outdated. It is deleted in this patch. * storage/indexeddb/deletedatabase-transaction-expected.txt: * storage/indexeddb/deletedatabase-transaction.html: * storage/indexeddb/dont-commit-on-blocked-expected.txt: * storage/indexeddb/dont-commit-on-blocked.html: * storage/indexeddb/lazy-index-population-expected.txt: * storage/indexeddb/lazy-index-population.html: * storage/indexeddb/mozilla/index-prev-no-duplicate-expected.txt: * storage/indexeddb/mozilla/index-prev-no-duplicate.html: * storage/indexeddb/mozilla/resources/object-identity.js: Test added here to replace test covered in tutorial.html * storage/indexeddb/noblobs-expected.txt: * storage/indexeddb/noblobs.html: * storage/indexeddb/resources/dont-commit-on-blocked-worker.js: (onSetVersionSuccess): * storage/indexeddb/structured-clone-expected.txt: * storage/indexeddb/structured-clone.html: * storage/indexeddb/transaction-complete-with-js-recursion-cross-frame-expected.txt: * storage/indexeddb/transaction-complete-with-js-recursion-cross-frame.html: * storage/indexeddb/transaction-complete-with-js-recursion-expected.txt: * storage/indexeddb/transaction-complete-with-js-recursion.html: * storage/indexeddb/tutorial-expected.txt: Removed. * storage/indexeddb/tutorial.html: Removed. Canonical link: https://commits.webkit.org/120423@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@134700 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-11-15 01:19:01 +00:00
indexedDB.open(dbname, 3)
IndexedDB: generate index keys for existing data in createIndex in front end https://bugs.webkit.org/show_bug.cgi?id=91125 Patch by Alec Flett <alecflett@chromium.org> on 2012-08-15 Reviewed by Tony Chang. Source/WebCore: Make createIndex() do index key generation in the frontend, rather than the backend. When an index is created, the frontend uses the cursor API to iterate through the values in the backend to generate keys, sending them back to the backend using IDBObjectStore::setIndexKeys() This confines all key injection/extraction to the frontend. The new test verifies the implemented behavior with respect to error handling in degenerate uses of put(), though that behavior is still in discussion as the spec is vague on the proper error behavior. Test: storage/indexeddb/lazy-index-population.html * Modules/indexeddb/IDBCursorBackendImpl.cpp: Make sure that the TaskType propagates throught the cursor and all subsequent continue() calls. (WebCore::IDBCursorBackendImpl::IDBCursorBackendImpl): (WebCore::IDBCursorBackendImpl::continueFunction): (WebCore::IDBCursorBackendImpl::prefetchContinue): * Modules/indexeddb/IDBCursorBackendImpl.h: (WebCore::IDBCursorBackendImpl::create): (IDBCursorBackendImpl): * Modules/indexeddb/IDBObjectStore.cpp: Add an IndexPopulator class to run a cursor from the frontend. (WebCore): (WebCore::IDBObjectStore::createIndex): (WebCore::IDBObjectStore::openCursor): * Modules/indexeddb/IDBObjectStore.h: (WebCore::IDBObjectStore::openCursor): (IDBObjectStore): (WebCore::IDBObjectStore::createIndex): * Modules/indexeddb/IDBObjectStore.idl: Pass along ScriptContext so that openCursor can be called from createIndex. * Modules/indexeddb/IDBObjectStoreBackendImpl.cpp: (WebCore): (WebCore::makeIndexWriters): (WebCore::IDBObjectStoreBackendImpl::setIndexKeys): (WebCore::IDBObjectStoreBackendImpl::setIndexesReady): (WebCore::IDBObjectStoreBackendImpl::setIndexesReadyInternal): (WebCore::IDBObjectStoreBackendImpl::putInternal): (WebCore::IDBObjectStoreBackendImpl::deleteInternal): (WebCore::IDBObjectStoreBackendImpl::createIndexInternal): (WebCore::IDBObjectStoreBackendImpl::openCursor): (WebCore::IDBObjectStoreBackendImpl::openCursorInternal): * Modules/indexeddb/IDBObjectStoreBackendImpl.h: (IDBObjectStoreBackendImpl): (WebCore::IDBObjectStoreBackendImpl::iterIndexesBegin): (WebCore::IDBObjectStoreBackendImpl::iterIndexesEnd): (WebCore::IDBObjectStoreBackendImpl::backingStore): (WebCore::IDBObjectStoreBackendImpl::databaseId): * Modules/indexeddb/IDBObjectStoreBackendInterface.h: * Modules/indexeddb/IDBRequest.cpp: Allow requests to keep their own TaskType, to give certain requests priority over others. (WebCore::IDBRequest::create): (WebCore): (WebCore::IDBRequest::IDBRequest): (WebCore::IDBRequest::abort): * Modules/indexeddb/IDBRequest.h: (IDBRequest): (WebCore::IDBRequest::taskType): * Modules/indexeddb/IDBTransactionBackendImpl.cpp: Introduce a second, higher priority event queue, m_preemptiveTaskQueue, which takes priority over the regular task queue. (WebCore::IDBTransactionBackendImpl::IDBTransactionBackendImpl): (WebCore::IDBTransactionBackendImpl::scheduleTask): (WebCore::IDBTransactionBackendImpl::isTaskQueueEmpty): (WebCore): (WebCore::IDBTransactionBackendImpl::commit): (WebCore::IDBTransactionBackendImpl::taskTimerFired): (WebCore::IDBTransactionBackendImpl::taskEventTimerFired): * Modules/indexeddb/IDBTransactionBackendImpl.h: (WebCore::IDBTransactionBackendImpl::scheduleTask): (IDBTransactionBackendImpl): (WebCore::IDBTransactionBackendImpl::addEarlyEvent): (WebCore::IDBTransactionBackendImpl::didCompleteEarlyEvent): * Modules/indexeddb/IDBVersionChangeRequest.cpp: (WebCore::IDBVersionChangeRequest::IDBVersionChangeRequest): Source/WebKit/chromium: Add Chromium API methods to let the renderer process tell the browser process about indexing progress. * public/WebIDBObjectStore.h: (WebKit::WebIDBObjectStore::openCursor): * src/IDBObjectStoreBackendProxy.cpp: (WebKit::IDBObjectStoreBackendProxy::setIndexKeys): (WebKit): (WebKit::IDBObjectStoreBackendProxy::setIndexesReady): (WebKit::IDBObjectStoreBackendProxy::openCursor): * src/IDBObjectStoreBackendProxy.h: (IDBObjectStoreBackendProxy): * src/WebIDBObjectStoreImpl.cpp: (WebKit::WebIDBObjectStoreImpl::setIndexKeys): (WebKit): (WebKit::WebIDBObjectStoreImpl::setIndexesReady): (WebKit::WebIDBObjectStoreImpl::openCursor): * src/WebIDBObjectStoreImpl.h: (WebIDBObjectStoreImpl): LayoutTests: The transaction should be aborted when existing data in an objectStore causes uniqueness errors during index creation. * storage/indexeddb/lazy-index-population-expected.txt: Added. * storage/indexeddb/lazy-index-population.html: Added. Canonical link: https://commits.webkit.org/111986@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@125728 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-08-16 00:50:52 +00:00
deleteAllObjectStores(connection)
Deleted all object stores.
store = connection.createObjectStore('store')
request1 = store.put({name: 'ted'}, 1)
request2 = store.put({name: 'ted'}, 2)
store.createIndex('index3', 'name', {unique: true})
state = 0
request1 received success event
PASS ++state is 1
request2 received success event
PASS ++state is 2
transaction aborted
PASS ++state is 3
IndexedDB: Pass type of error causing abort to IDBTransaction::onAbort https://bugs.webkit.org/show_bug.cgi?id=99097 Reviewed by Tony Chang. Source/WebCore: Include the error causing the abort in the callback from back end to front end so it can be exposed on the IDBTransaction.error property. Test: lazy-index-population.html * Modules/indexeddb/IDBDatabaseBackendImpl.cpp: (WebCore::IDBDatabaseBackendImpl::setVersionInternal): (WebCore::IDBDatabaseBackendImpl::setIntVersionInternal): * Modules/indexeddb/IDBDatabaseCallbacks.h: * Modules/indexeddb/IDBObjectStoreBackendImpl.cpp: (WebCore::IDBObjectStoreBackendImpl::setIndexKeys): (WebCore::IDBObjectStoreBackendImpl::putInternal): * Modules/indexeddb/IDBTransaction.cpp: (WebCore::IDBTransaction::onAbort): * Modules/indexeddb/IDBTransaction.h: (IDBTransaction): * Modules/indexeddb/IDBTransactionBackendImpl.cpp: (WebCore::IDBTransactionBackendImpl::abort): (WebCore): (WebCore::IDBTransactionBackendImpl::commit): * Modules/indexeddb/IDBTransactionBackendImpl.h: (IDBTransactionBackendImpl): * Modules/indexeddb/IDBTransactionCallbacks.h: (IDBTransactionCallbacks): * inspector/InspectorIndexedDBAgent.cpp: (WebCore): Source/WebKit/chromium: Plumbing to pass details about the cause of the transaction abort through to the front end. * public/WebIDBTransactionCallbacks.h: (WebKit): (WebKit::WebIDBTransactionCallbacks::onAbort): * src/IDBTransactionCallbacksProxy.cpp: (WebKit::IDBTransactionCallbacksProxy::onAbort): * src/IDBTransactionCallbacksProxy.h: (IDBTransactionCallbacksProxy): * src/WebIDBTransactionCallbacksImpl.cpp: (WebKit::WebIDBTransactionCallbacksImpl::onAbort): * src/WebIDBTransactionCallbacksImpl.h: (WebIDBTransactionCallbacksImpl): LayoutTests: Verify that IDBTransaction.error is reporting ConstraintError when indexing fails. * storage/indexeddb/lazy-index-population-expected.txt: * storage/indexeddb/lazy-index-population.html: Canonical link: https://commits.webkit.org/117336@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@131371 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-10-15 22:19:08 +00:00
PASS trans.error.name is 'ConstraintError'
IndexedDB: generate index keys for existing data in createIndex in front end https://bugs.webkit.org/show_bug.cgi?id=91125 Patch by Alec Flett <alecflett@chromium.org> on 2012-08-15 Reviewed by Tony Chang. Source/WebCore: Make createIndex() do index key generation in the frontend, rather than the backend. When an index is created, the frontend uses the cursor API to iterate through the values in the backend to generate keys, sending them back to the backend using IDBObjectStore::setIndexKeys() This confines all key injection/extraction to the frontend. The new test verifies the implemented behavior with respect to error handling in degenerate uses of put(), though that behavior is still in discussion as the spec is vague on the proper error behavior. Test: storage/indexeddb/lazy-index-population.html * Modules/indexeddb/IDBCursorBackendImpl.cpp: Make sure that the TaskType propagates throught the cursor and all subsequent continue() calls. (WebCore::IDBCursorBackendImpl::IDBCursorBackendImpl): (WebCore::IDBCursorBackendImpl::continueFunction): (WebCore::IDBCursorBackendImpl::prefetchContinue): * Modules/indexeddb/IDBCursorBackendImpl.h: (WebCore::IDBCursorBackendImpl::create): (IDBCursorBackendImpl): * Modules/indexeddb/IDBObjectStore.cpp: Add an IndexPopulator class to run a cursor from the frontend. (WebCore): (WebCore::IDBObjectStore::createIndex): (WebCore::IDBObjectStore::openCursor): * Modules/indexeddb/IDBObjectStore.h: (WebCore::IDBObjectStore::openCursor): (IDBObjectStore): (WebCore::IDBObjectStore::createIndex): * Modules/indexeddb/IDBObjectStore.idl: Pass along ScriptContext so that openCursor can be called from createIndex. * Modules/indexeddb/IDBObjectStoreBackendImpl.cpp: (WebCore): (WebCore::makeIndexWriters): (WebCore::IDBObjectStoreBackendImpl::setIndexKeys): (WebCore::IDBObjectStoreBackendImpl::setIndexesReady): (WebCore::IDBObjectStoreBackendImpl::setIndexesReadyInternal): (WebCore::IDBObjectStoreBackendImpl::putInternal): (WebCore::IDBObjectStoreBackendImpl::deleteInternal): (WebCore::IDBObjectStoreBackendImpl::createIndexInternal): (WebCore::IDBObjectStoreBackendImpl::openCursor): (WebCore::IDBObjectStoreBackendImpl::openCursorInternal): * Modules/indexeddb/IDBObjectStoreBackendImpl.h: (IDBObjectStoreBackendImpl): (WebCore::IDBObjectStoreBackendImpl::iterIndexesBegin): (WebCore::IDBObjectStoreBackendImpl::iterIndexesEnd): (WebCore::IDBObjectStoreBackendImpl::backingStore): (WebCore::IDBObjectStoreBackendImpl::databaseId): * Modules/indexeddb/IDBObjectStoreBackendInterface.h: * Modules/indexeddb/IDBRequest.cpp: Allow requests to keep their own TaskType, to give certain requests priority over others. (WebCore::IDBRequest::create): (WebCore): (WebCore::IDBRequest::IDBRequest): (WebCore::IDBRequest::abort): * Modules/indexeddb/IDBRequest.h: (IDBRequest): (WebCore::IDBRequest::taskType): * Modules/indexeddb/IDBTransactionBackendImpl.cpp: Introduce a second, higher priority event queue, m_preemptiveTaskQueue, which takes priority over the regular task queue. (WebCore::IDBTransactionBackendImpl::IDBTransactionBackendImpl): (WebCore::IDBTransactionBackendImpl::scheduleTask): (WebCore::IDBTransactionBackendImpl::isTaskQueueEmpty): (WebCore): (WebCore::IDBTransactionBackendImpl::commit): (WebCore::IDBTransactionBackendImpl::taskTimerFired): (WebCore::IDBTransactionBackendImpl::taskEventTimerFired): * Modules/indexeddb/IDBTransactionBackendImpl.h: (WebCore::IDBTransactionBackendImpl::scheduleTask): (IDBTransactionBackendImpl): (WebCore::IDBTransactionBackendImpl::addEarlyEvent): (WebCore::IDBTransactionBackendImpl::didCompleteEarlyEvent): * Modules/indexeddb/IDBVersionChangeRequest.cpp: (WebCore::IDBVersionChangeRequest::IDBVersionChangeRequest): Source/WebKit/chromium: Add Chromium API methods to let the renderer process tell the browser process about indexing progress. * public/WebIDBObjectStore.h: (WebKit::WebIDBObjectStore::openCursor): * src/IDBObjectStoreBackendProxy.cpp: (WebKit::IDBObjectStoreBackendProxy::setIndexKeys): (WebKit): (WebKit::IDBObjectStoreBackendProxy::setIndexesReady): (WebKit::IDBObjectStoreBackendProxy::openCursor): * src/IDBObjectStoreBackendProxy.h: (IDBObjectStoreBackendProxy): * src/WebIDBObjectStoreImpl.cpp: (WebKit::WebIDBObjectStoreImpl::setIndexKeys): (WebKit): (WebKit::WebIDBObjectStoreImpl::setIndexesReady): (WebKit::WebIDBObjectStoreImpl::openCursor): * src/WebIDBObjectStoreImpl.h: (WebIDBObjectStoreImpl): LayoutTests: The transaction should be aborted when existing data in an objectStore causes uniqueness errors during index creation. * storage/indexeddb/lazy-index-population-expected.txt: Added. * storage/indexeddb/lazy-index-population.html: Added. Canonical link: https://commits.webkit.org/111986@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@125728 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-08-16 00:50:52 +00:00
Verify that uniqueness constraints are enforced when index is created between puts:
IndexedDB: Test conversions batch 4 https://bugs.webkit.org/show_bug.cgi?id=102267 Reviewed by Tony Chang. These are tests that don't have the js file in resources. The only interesting bit is that lazy-index-population uncovered a potential bug. I think tutorial.html has outlived its usefulness now that there are more tutorials on the web. It was very outdated. It is deleted in this patch. * storage/indexeddb/deletedatabase-transaction-expected.txt: * storage/indexeddb/deletedatabase-transaction.html: * storage/indexeddb/dont-commit-on-blocked-expected.txt: * storage/indexeddb/dont-commit-on-blocked.html: * storage/indexeddb/lazy-index-population-expected.txt: * storage/indexeddb/lazy-index-population.html: * storage/indexeddb/mozilla/index-prev-no-duplicate-expected.txt: * storage/indexeddb/mozilla/index-prev-no-duplicate.html: * storage/indexeddb/mozilla/resources/object-identity.js: Test added here to replace test covered in tutorial.html * storage/indexeddb/noblobs-expected.txt: * storage/indexeddb/noblobs.html: * storage/indexeddb/resources/dont-commit-on-blocked-worker.js: (onSetVersionSuccess): * storage/indexeddb/structured-clone-expected.txt: * storage/indexeddb/structured-clone.html: * storage/indexeddb/transaction-complete-with-js-recursion-cross-frame-expected.txt: * storage/indexeddb/transaction-complete-with-js-recursion-cross-frame.html: * storage/indexeddb/transaction-complete-with-js-recursion-expected.txt: * storage/indexeddb/transaction-complete-with-js-recursion.html: * storage/indexeddb/tutorial-expected.txt: Removed. * storage/indexeddb/tutorial.html: Removed. Canonical link: https://commits.webkit.org/120423@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@134700 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-11-15 01:19:01 +00:00
indexedDB.open(dbname, 4)
IndexedDB: generate index keys for existing data in createIndex in front end https://bugs.webkit.org/show_bug.cgi?id=91125 Patch by Alec Flett <alecflett@chromium.org> on 2012-08-15 Reviewed by Tony Chang. Source/WebCore: Make createIndex() do index key generation in the frontend, rather than the backend. When an index is created, the frontend uses the cursor API to iterate through the values in the backend to generate keys, sending them back to the backend using IDBObjectStore::setIndexKeys() This confines all key injection/extraction to the frontend. The new test verifies the implemented behavior with respect to error handling in degenerate uses of put(), though that behavior is still in discussion as the spec is vague on the proper error behavior. Test: storage/indexeddb/lazy-index-population.html * Modules/indexeddb/IDBCursorBackendImpl.cpp: Make sure that the TaskType propagates throught the cursor and all subsequent continue() calls. (WebCore::IDBCursorBackendImpl::IDBCursorBackendImpl): (WebCore::IDBCursorBackendImpl::continueFunction): (WebCore::IDBCursorBackendImpl::prefetchContinue): * Modules/indexeddb/IDBCursorBackendImpl.h: (WebCore::IDBCursorBackendImpl::create): (IDBCursorBackendImpl): * Modules/indexeddb/IDBObjectStore.cpp: Add an IndexPopulator class to run a cursor from the frontend. (WebCore): (WebCore::IDBObjectStore::createIndex): (WebCore::IDBObjectStore::openCursor): * Modules/indexeddb/IDBObjectStore.h: (WebCore::IDBObjectStore::openCursor): (IDBObjectStore): (WebCore::IDBObjectStore::createIndex): * Modules/indexeddb/IDBObjectStore.idl: Pass along ScriptContext so that openCursor can be called from createIndex. * Modules/indexeddb/IDBObjectStoreBackendImpl.cpp: (WebCore): (WebCore::makeIndexWriters): (WebCore::IDBObjectStoreBackendImpl::setIndexKeys): (WebCore::IDBObjectStoreBackendImpl::setIndexesReady): (WebCore::IDBObjectStoreBackendImpl::setIndexesReadyInternal): (WebCore::IDBObjectStoreBackendImpl::putInternal): (WebCore::IDBObjectStoreBackendImpl::deleteInternal): (WebCore::IDBObjectStoreBackendImpl::createIndexInternal): (WebCore::IDBObjectStoreBackendImpl::openCursor): (WebCore::IDBObjectStoreBackendImpl::openCursorInternal): * Modules/indexeddb/IDBObjectStoreBackendImpl.h: (IDBObjectStoreBackendImpl): (WebCore::IDBObjectStoreBackendImpl::iterIndexesBegin): (WebCore::IDBObjectStoreBackendImpl::iterIndexesEnd): (WebCore::IDBObjectStoreBackendImpl::backingStore): (WebCore::IDBObjectStoreBackendImpl::databaseId): * Modules/indexeddb/IDBObjectStoreBackendInterface.h: * Modules/indexeddb/IDBRequest.cpp: Allow requests to keep their own TaskType, to give certain requests priority over others. (WebCore::IDBRequest::create): (WebCore): (WebCore::IDBRequest::IDBRequest): (WebCore::IDBRequest::abort): * Modules/indexeddb/IDBRequest.h: (IDBRequest): (WebCore::IDBRequest::taskType): * Modules/indexeddb/IDBTransactionBackendImpl.cpp: Introduce a second, higher priority event queue, m_preemptiveTaskQueue, which takes priority over the regular task queue. (WebCore::IDBTransactionBackendImpl::IDBTransactionBackendImpl): (WebCore::IDBTransactionBackendImpl::scheduleTask): (WebCore::IDBTransactionBackendImpl::isTaskQueueEmpty): (WebCore): (WebCore::IDBTransactionBackendImpl::commit): (WebCore::IDBTransactionBackendImpl::taskTimerFired): (WebCore::IDBTransactionBackendImpl::taskEventTimerFired): * Modules/indexeddb/IDBTransactionBackendImpl.h: (WebCore::IDBTransactionBackendImpl::scheduleTask): (IDBTransactionBackendImpl): (WebCore::IDBTransactionBackendImpl::addEarlyEvent): (WebCore::IDBTransactionBackendImpl::didCompleteEarlyEvent): * Modules/indexeddb/IDBVersionChangeRequest.cpp: (WebCore::IDBVersionChangeRequest::IDBVersionChangeRequest): Source/WebKit/chromium: Add Chromium API methods to let the renderer process tell the browser process about indexing progress. * public/WebIDBObjectStore.h: (WebKit::WebIDBObjectStore::openCursor): * src/IDBObjectStoreBackendProxy.cpp: (WebKit::IDBObjectStoreBackendProxy::setIndexKeys): (WebKit): (WebKit::IDBObjectStoreBackendProxy::setIndexesReady): (WebKit::IDBObjectStoreBackendProxy::openCursor): * src/IDBObjectStoreBackendProxy.h: (IDBObjectStoreBackendProxy): * src/WebIDBObjectStoreImpl.cpp: (WebKit::WebIDBObjectStoreImpl::setIndexKeys): (WebKit): (WebKit::WebIDBObjectStoreImpl::setIndexesReady): (WebKit::WebIDBObjectStoreImpl::openCursor): * src/WebIDBObjectStoreImpl.h: (WebIDBObjectStoreImpl): LayoutTests: The transaction should be aborted when existing data in an objectStore causes uniqueness errors during index creation. * storage/indexeddb/lazy-index-population-expected.txt: Added. * storage/indexeddb/lazy-index-population.html: Added. Canonical link: https://commits.webkit.org/111986@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@125728 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-08-16 00:50:52 +00:00
deleteAllObjectStores(connection)
Deleted all object stores.
store = connection.createObjectStore('store')
request1 = store.put({name: 'alice'}, 1)
store.createIndex('index4', 'name', {unique: true})
request2 = store.put({name: 'alice'}, 2)
state = 0
request1 received success event
PASS ++state is 1
request2 received error event
PASS ++state is 2
transaction aborted
PASS ++state is 3
IndexedDB: Pass type of error causing abort to IDBTransaction::onAbort https://bugs.webkit.org/show_bug.cgi?id=99097 Reviewed by Tony Chang. Source/WebCore: Include the error causing the abort in the callback from back end to front end so it can be exposed on the IDBTransaction.error property. Test: lazy-index-population.html * Modules/indexeddb/IDBDatabaseBackendImpl.cpp: (WebCore::IDBDatabaseBackendImpl::setVersionInternal): (WebCore::IDBDatabaseBackendImpl::setIntVersionInternal): * Modules/indexeddb/IDBDatabaseCallbacks.h: * Modules/indexeddb/IDBObjectStoreBackendImpl.cpp: (WebCore::IDBObjectStoreBackendImpl::setIndexKeys): (WebCore::IDBObjectStoreBackendImpl::putInternal): * Modules/indexeddb/IDBTransaction.cpp: (WebCore::IDBTransaction::onAbort): * Modules/indexeddb/IDBTransaction.h: (IDBTransaction): * Modules/indexeddb/IDBTransactionBackendImpl.cpp: (WebCore::IDBTransactionBackendImpl::abort): (WebCore): (WebCore::IDBTransactionBackendImpl::commit): * Modules/indexeddb/IDBTransactionBackendImpl.h: (IDBTransactionBackendImpl): * Modules/indexeddb/IDBTransactionCallbacks.h: (IDBTransactionCallbacks): * inspector/InspectorIndexedDBAgent.cpp: (WebCore): Source/WebKit/chromium: Plumbing to pass details about the cause of the transaction abort through to the front end. * public/WebIDBTransactionCallbacks.h: (WebKit): (WebKit::WebIDBTransactionCallbacks::onAbort): * src/IDBTransactionCallbacksProxy.cpp: (WebKit::IDBTransactionCallbacksProxy::onAbort): * src/IDBTransactionCallbacksProxy.h: (IDBTransactionCallbacksProxy): * src/WebIDBTransactionCallbacksImpl.cpp: (WebKit::WebIDBTransactionCallbacksImpl::onAbort): * src/WebIDBTransactionCallbacksImpl.h: (WebIDBTransactionCallbacksImpl): LayoutTests: Verify that IDBTransaction.error is reporting ConstraintError when indexing fails. * storage/indexeddb/lazy-index-population-expected.txt: * storage/indexeddb/lazy-index-population.html: Canonical link: https://commits.webkit.org/117336@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@131371 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-10-15 22:19:08 +00:00
PASS trans.error.name is 'ConstraintError'
IndexedDB: generate index keys for existing data in createIndex in front end https://bugs.webkit.org/show_bug.cgi?id=91125 Patch by Alec Flett <alecflett@chromium.org> on 2012-08-15 Reviewed by Tony Chang. Source/WebCore: Make createIndex() do index key generation in the frontend, rather than the backend. When an index is created, the frontend uses the cursor API to iterate through the values in the backend to generate keys, sending them back to the backend using IDBObjectStore::setIndexKeys() This confines all key injection/extraction to the frontend. The new test verifies the implemented behavior with respect to error handling in degenerate uses of put(), though that behavior is still in discussion as the spec is vague on the proper error behavior. Test: storage/indexeddb/lazy-index-population.html * Modules/indexeddb/IDBCursorBackendImpl.cpp: Make sure that the TaskType propagates throught the cursor and all subsequent continue() calls. (WebCore::IDBCursorBackendImpl::IDBCursorBackendImpl): (WebCore::IDBCursorBackendImpl::continueFunction): (WebCore::IDBCursorBackendImpl::prefetchContinue): * Modules/indexeddb/IDBCursorBackendImpl.h: (WebCore::IDBCursorBackendImpl::create): (IDBCursorBackendImpl): * Modules/indexeddb/IDBObjectStore.cpp: Add an IndexPopulator class to run a cursor from the frontend. (WebCore): (WebCore::IDBObjectStore::createIndex): (WebCore::IDBObjectStore::openCursor): * Modules/indexeddb/IDBObjectStore.h: (WebCore::IDBObjectStore::openCursor): (IDBObjectStore): (WebCore::IDBObjectStore::createIndex): * Modules/indexeddb/IDBObjectStore.idl: Pass along ScriptContext so that openCursor can be called from createIndex. * Modules/indexeddb/IDBObjectStoreBackendImpl.cpp: (WebCore): (WebCore::makeIndexWriters): (WebCore::IDBObjectStoreBackendImpl::setIndexKeys): (WebCore::IDBObjectStoreBackendImpl::setIndexesReady): (WebCore::IDBObjectStoreBackendImpl::setIndexesReadyInternal): (WebCore::IDBObjectStoreBackendImpl::putInternal): (WebCore::IDBObjectStoreBackendImpl::deleteInternal): (WebCore::IDBObjectStoreBackendImpl::createIndexInternal): (WebCore::IDBObjectStoreBackendImpl::openCursor): (WebCore::IDBObjectStoreBackendImpl::openCursorInternal): * Modules/indexeddb/IDBObjectStoreBackendImpl.h: (IDBObjectStoreBackendImpl): (WebCore::IDBObjectStoreBackendImpl::iterIndexesBegin): (WebCore::IDBObjectStoreBackendImpl::iterIndexesEnd): (WebCore::IDBObjectStoreBackendImpl::backingStore): (WebCore::IDBObjectStoreBackendImpl::databaseId): * Modules/indexeddb/IDBObjectStoreBackendInterface.h: * Modules/indexeddb/IDBRequest.cpp: Allow requests to keep their own TaskType, to give certain requests priority over others. (WebCore::IDBRequest::create): (WebCore): (WebCore::IDBRequest::IDBRequest): (WebCore::IDBRequest::abort): * Modules/indexeddb/IDBRequest.h: (IDBRequest): (WebCore::IDBRequest::taskType): * Modules/indexeddb/IDBTransactionBackendImpl.cpp: Introduce a second, higher priority event queue, m_preemptiveTaskQueue, which takes priority over the regular task queue. (WebCore::IDBTransactionBackendImpl::IDBTransactionBackendImpl): (WebCore::IDBTransactionBackendImpl::scheduleTask): (WebCore::IDBTransactionBackendImpl::isTaskQueueEmpty): (WebCore): (WebCore::IDBTransactionBackendImpl::commit): (WebCore::IDBTransactionBackendImpl::taskTimerFired): (WebCore::IDBTransactionBackendImpl::taskEventTimerFired): * Modules/indexeddb/IDBTransactionBackendImpl.h: (WebCore::IDBTransactionBackendImpl::scheduleTask): (IDBTransactionBackendImpl): (WebCore::IDBTransactionBackendImpl::addEarlyEvent): (WebCore::IDBTransactionBackendImpl::didCompleteEarlyEvent): * Modules/indexeddb/IDBVersionChangeRequest.cpp: (WebCore::IDBVersionChangeRequest::IDBVersionChangeRequest): Source/WebKit/chromium: Add Chromium API methods to let the renderer process tell the browser process about indexing progress. * public/WebIDBObjectStore.h: (WebKit::WebIDBObjectStore::openCursor): * src/IDBObjectStoreBackendProxy.cpp: (WebKit::IDBObjectStoreBackendProxy::setIndexKeys): (WebKit): (WebKit::IDBObjectStoreBackendProxy::setIndexesReady): (WebKit::IDBObjectStoreBackendProxy::openCursor): * src/IDBObjectStoreBackendProxy.h: (IDBObjectStoreBackendProxy): * src/WebIDBObjectStoreImpl.cpp: (WebKit::WebIDBObjectStoreImpl::setIndexKeys): (WebKit): (WebKit::WebIDBObjectStoreImpl::setIndexesReady): (WebKit::WebIDBObjectStoreImpl::openCursor): * src/WebIDBObjectStoreImpl.h: (WebIDBObjectStoreImpl): LayoutTests: The transaction should be aborted when existing data in an objectStore causes uniqueness errors during index creation. * storage/indexeddb/lazy-index-population-expected.txt: Added. * storage/indexeddb/lazy-index-population.html: Added. Canonical link: https://commits.webkit.org/111986@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@125728 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-08-16 00:50:52 +00:00
PASS successfullyParsed is true
TEST COMPLETE