IndexedDB: Implement IDBTransaction.error and IDBRequest.error
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 31 May 2012 22:47:34 +0000 (22:47 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 31 May 2012 22:47:34 +0000 (22:47 +0000)
commit1952e22e76875d15583e7484e96d446a3052e906
tree019d8b3c96b2521593dd669d81b889a2364f0efd
parent93f3791c0bd66b0da59f79557027aebc8efed419
IndexedDB: Implement IDBTransaction.error and IDBRequest.error
https://bugs.webkit.org/show_bug.cgi?id=87865

Patch by Alec Flett <alecflett@chromium.org> on 2012-05-31
Reviewed by Tony Chang.

Source/WebCore:

Added "error" attribute to IDBRequest and IDBTransaction. Update
IDBDatabaseError to honor the IDBDatabaseException behavior
of dealing with IDB-specific throws of DOMException codes,
as per the spec.

Existing tests which previously tested 'errorCode' and
'webkitErrorMessage' have been updated to use the new attribute.

* Modules/indexeddb/IDBCursor.cpp:
(WebCore::IDBCursor::advance):
* Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
(WebCore::IDBDatabaseBackendImpl::setVersion):
* Modules/indexeddb/IDBDatabaseError.h:
(WebCore::IDBDatabaseError::create):
(WebCore::IDBDatabaseError::code):
(WebCore::IDBDatabaseError::idbCode):
(WebCore::IDBDatabaseError::name):
(WebCore::IDBDatabaseError::IDBDatabaseError):
(IDBDatabaseError):
* Modules/indexeddb/IDBDatabaseException.cpp:
(WebCore):
(WebCore::getErrorEntry):
(WebCore::IDBDatabaseException::initializeDescription):
(WebCore::IDBDatabaseException::getErrorName):
(WebCore::IDBDatabaseException::getLegacyErrorCode):
* Modules/indexeddb/IDBDatabaseException.h:
(IDBDatabaseException):
* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::createIndex):
* Modules/indexeddb/IDBRequest.cpp:
(WebCore::IDBRequest::error):
(WebCore):
(WebCore::IDBRequest::resetReadyState):
(WebCore::IDBRequest::abort):
(WebCore::IDBRequest::onError):
(WebCore::IDBRequest::onSuccess):
(WebCore::IDBRequest::onSuccessWithContinuation):
(WebCore::IDBRequest::dispatchEvent):
* Modules/indexeddb/IDBRequest.h:
(IDBRequest):
* Modules/indexeddb/IDBRequest.idl:
* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::error):
(WebCore):
(WebCore::IDBTransaction::setError):
* Modules/indexeddb/IDBTransaction.h:
(IDBTransaction):
* Modules/indexeddb/IDBTransaction.idl:

Source/WebKit/chromium:

IDBDatabaseError now honors IDB-specific DOMException codes,
so make sure that's how they are passed to/from chromium.

* src/WebIDBDatabaseError.cpp:
(WebKit::WebIDBDatabaseError::assign):

LayoutTests:

* storage/indexeddb/basics-expected.txt:
* storage/indexeddb/basics-workers-expected.txt:
* storage/indexeddb/create-and-remove-object-store-expected.txt:
* storage/indexeddb/cursor-continue-expected.txt:
* storage/indexeddb/cursor-update-expected.txt:
* storage/indexeddb/database-basics-expected.txt:
* storage/indexeddb/deleteIndex-expected.txt:
* storage/indexeddb/factory-cmp-expected.txt:
* storage/indexeddb/get-keyrange-expected.txt:
* storage/indexeddb/index-basics-expected.txt:
* storage/indexeddb/index-basics-workers-expected.txt:
* storage/indexeddb/index-count-expected.txt:
* storage/indexeddb/index-unique-expected.txt:
* storage/indexeddb/invalid-keys-expected.txt:
* storage/indexeddb/key-generator-expected.txt:
* storage/indexeddb/key-type-array-expected.txt:
* storage/indexeddb/keypath-edges-expected.txt:
* storage/indexeddb/keyrange-expected.txt:
* storage/indexeddb/objectstore-autoincrement-expected.txt:
* storage/indexeddb/objectstore-basics-expected.txt:
* storage/indexeddb/objectstore-basics-workers-expected.txt:
* storage/indexeddb/objectstore-count-expected.txt:
* storage/indexeddb/open-cursor-expected.txt:
* storage/indexeddb/readonly-expected.txt:
* storage/indexeddb/resources/basics.js:
(test):
(openCallback):
* storage/indexeddb/resources/create-and-remove-object-store.js:
(testCreateAndRemove):
(cleanDatabase):
(tryOnceMore):
* storage/indexeddb/resources/cursor-continue.js:
(ascendingErrorTestLessThan.request.onsuccess):
(ascendingErrorTestLessThan):
(ascendingErrorTestEqual.request.onsuccess):
(ascendingErrorTestEqual):
(descendingErrorTestGreaterThan.request.onsuccess):
(descendingErrorTestGreaterThan):
(descendingErrorTestEqual.request.onsuccess):
(descendingErrorTestEqual):
(onTransactionComplete):
* storage/indexeddb/resources/cursor-update.js:
(keyCursor):
* storage/indexeddb/resources/database-basics.js:
(testClose):
* storage/indexeddb/resources/database-quota.js:
(logError):
* storage/indexeddb/resources/deleteIndex.js:
(twiddleIndexes):
(postTwiddling):
* storage/indexeddb/resources/factory-cmp.js:
(testValidKeys):
(testInvalidKeys):
* storage/indexeddb/resources/get-keyrange.js:
(getNullTest):
* storage/indexeddb/resources/index-basics.js:
(index3Count):
* storage/indexeddb/resources/index-count.js:
* storage/indexeddb/resources/index-unique.js:
(addMoreDataFailed):
* storage/indexeddb/resources/invalid-keys.js:
* storage/indexeddb/resources/key-generator.js:
* storage/indexeddb/resources/key-type-array.js:
(testDepthLimits):
* storage/indexeddb/resources/keypath-edges.js:
* storage/indexeddb/resources/keyrange.js:
(test):
* storage/indexeddb/resources/objectstore-autoincrement.js:
(getAbrahamSuccess):
* storage/indexeddb/resources/objectstore-basics.js:
(setVersionSuccess):
(createIndex):
(addAgainFailure):
(removeSuccessButNotThere):
(testPreConditions.request.onsuccess):
(testPreConditions):
* storage/indexeddb/resources/objectstore-count.js:
* storage/indexeddb/resources/open-cursor.js:
(cursorWithKeySuccess):
(cursorSuccess):
* storage/indexeddb/resources/readonly.js:
(openSuccess):
* storage/indexeddb/resources/set_version_queue.js:
(connectionError):
* storage/indexeddb/resources/shared.js:
(unexpectedErrorCallback):
(evalAndExpectException):
* storage/indexeddb/resources/transaction-abort-workers.js:
(transactionAborted):
(transactionCompleted):
(timeoutTest.transaction.onabort):
(timeoutTest):
(errorTransactionAborted):
* storage/indexeddb/resources/transaction-abort.js:
(firstAdd):
(secondAdd):
(transactionAborted):
* storage/indexeddb/resources/transaction-after-close.js:
(firstTransactionComplete):
* storage/indexeddb/resources/transaction-and-objectstore-calls.js:
(created):
(afterComplete):
* storage/indexeddb/resources/transaction-basics.js:
(testInactiveAbortedTransaction):
(testInactiveCompletedTransaction):
(testInvalidMode):
* storage/indexeddb/resources/transaction-read-only.js:
(setVersionDone):
(gotCursor):
* storage/indexeddb/set_version_queue-expected.txt:
* storage/indexeddb/transaction-abort-expected.txt:
* storage/indexeddb/transaction-abort-workers-expected.txt:
* storage/indexeddb/transaction-after-close-expected.txt:
* storage/indexeddb/transaction-and-objectstore-calls-expected.txt:
* storage/indexeddb/transaction-basics-expected.txt:
* storage/indexeddb/transaction-read-only-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@119161 268f45cc-cd09-0410-ab3c-d52691b4dbfc
78 files changed:
LayoutTests/ChangeLog
LayoutTests/storage/indexeddb/basics-expected.txt
LayoutTests/storage/indexeddb/basics-shared-workers-expected.txt
LayoutTests/storage/indexeddb/basics-workers-expected.txt
LayoutTests/storage/indexeddb/create-and-remove-object-store-expected.txt
LayoutTests/storage/indexeddb/cursor-continue-expected.txt
LayoutTests/storage/indexeddb/cursor-update-expected.txt
LayoutTests/storage/indexeddb/database-basics-expected.txt
LayoutTests/storage/indexeddb/deleteIndex-expected.txt
LayoutTests/storage/indexeddb/factory-cmp-expected.txt
LayoutTests/storage/indexeddb/get-keyrange-expected.txt
LayoutTests/storage/indexeddb/index-basics-expected.txt
LayoutTests/storage/indexeddb/index-basics-workers-expected.txt
LayoutTests/storage/indexeddb/index-count-expected.txt
LayoutTests/storage/indexeddb/index-unique-expected.txt
LayoutTests/storage/indexeddb/invalid-keys-expected.txt
LayoutTests/storage/indexeddb/key-generator-expected.txt
LayoutTests/storage/indexeddb/key-type-array-expected.txt
LayoutTests/storage/indexeddb/keypath-edges-expected.txt
LayoutTests/storage/indexeddb/keyrange-expected.txt
LayoutTests/storage/indexeddb/objectstore-autoincrement-expected.txt
LayoutTests/storage/indexeddb/objectstore-basics-expected.txt
LayoutTests/storage/indexeddb/objectstore-basics-workers-expected.txt
LayoutTests/storage/indexeddb/objectstore-count-expected.txt
LayoutTests/storage/indexeddb/open-cursor-expected.txt
LayoutTests/storage/indexeddb/readonly-expected.txt
LayoutTests/storage/indexeddb/resources/basics.js
LayoutTests/storage/indexeddb/resources/create-and-remove-object-store.js
LayoutTests/storage/indexeddb/resources/cursor-continue.js
LayoutTests/storage/indexeddb/resources/cursor-update.js
LayoutTests/storage/indexeddb/resources/database-basics.js
LayoutTests/storage/indexeddb/resources/database-quota.js
LayoutTests/storage/indexeddb/resources/deleteIndex.js
LayoutTests/storage/indexeddb/resources/factory-cmp.js
LayoutTests/storage/indexeddb/resources/get-keyrange.js
LayoutTests/storage/indexeddb/resources/index-basics.js
LayoutTests/storage/indexeddb/resources/index-count.js
LayoutTests/storage/indexeddb/resources/index-unique.js
LayoutTests/storage/indexeddb/resources/invalid-keys.js
LayoutTests/storage/indexeddb/resources/key-generator.js
LayoutTests/storage/indexeddb/resources/key-type-array.js
LayoutTests/storage/indexeddb/resources/keypath-edges.js
LayoutTests/storage/indexeddb/resources/keyrange.js
LayoutTests/storage/indexeddb/resources/objectstore-autoincrement.js
LayoutTests/storage/indexeddb/resources/objectstore-basics.js
LayoutTests/storage/indexeddb/resources/objectstore-count.js
LayoutTests/storage/indexeddb/resources/open-cursor.js
LayoutTests/storage/indexeddb/resources/readonly.js
LayoutTests/storage/indexeddb/resources/set_version_queue.js
LayoutTests/storage/indexeddb/resources/shared.js
LayoutTests/storage/indexeddb/resources/transaction-abort-workers.js
LayoutTests/storage/indexeddb/resources/transaction-abort.js
LayoutTests/storage/indexeddb/resources/transaction-after-close.js
LayoutTests/storage/indexeddb/resources/transaction-and-objectstore-calls.js
LayoutTests/storage/indexeddb/resources/transaction-basics.js
LayoutTests/storage/indexeddb/resources/transaction-read-only.js
LayoutTests/storage/indexeddb/set_version_queue-expected.txt
LayoutTests/storage/indexeddb/transaction-abort-expected.txt
LayoutTests/storage/indexeddb/transaction-abort-workers-expected.txt
LayoutTests/storage/indexeddb/transaction-after-close-expected.txt
LayoutTests/storage/indexeddb/transaction-and-objectstore-calls-expected.txt
LayoutTests/storage/indexeddb/transaction-basics-expected.txt
LayoutTests/storage/indexeddb/transaction-read-only-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/Modules/indexeddb/IDBCursor.cpp
Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.cpp
Source/WebCore/Modules/indexeddb/IDBDatabaseError.h
Source/WebCore/Modules/indexeddb/IDBDatabaseException.cpp
Source/WebCore/Modules/indexeddb/IDBDatabaseException.h
Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp
Source/WebCore/Modules/indexeddb/IDBRequest.cpp
Source/WebCore/Modules/indexeddb/IDBRequest.h
Source/WebCore/Modules/indexeddb/IDBRequest.idl
Source/WebCore/Modules/indexeddb/IDBTransaction.cpp
Source/WebCore/Modules/indexeddb/IDBTransaction.h
Source/WebCore/Modules/indexeddb/IDBTransaction.idl
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/src/WebIDBDatabaseError.cpp