IndexedDB: Explicitly send null/undefined/integers to frontend IDBCallbacks
authoralecflett@chromium.org <alecflett@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 17 Oct 2012 22:57:30 +0000 (22:57 +0000)
committeralecflett@chromium.org <alecflett@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 17 Oct 2012 22:57:30 +0000 (22:57 +0000)
commite3b761fa90ee6b26c5fd52a991c843981dde84ba
treea5f6ec43a4cd1b612db9b83e377e668bb62eee36
parent539a796dd4d59b4ac239ec9aa9ec7a5698311961
IndexedDB: Explicitly send null/undefined/integers to frontend IDBCallbacks
https://bugs.webkit.org/show_bug.cgi?id=99619

Reviewed by Adam Barth.

Source/WebCore:

Rather than pass SerializedScriptValue tokens from the backend,
send explicit null, (as onSuccess(static_cast<SerializedScriptValue*>(0)))
undefined, (as onSucess()), and integers (as onSuccess(long long))

This reduces backend dependency on things that might require a JS
interpreter on the backend.

No new tests, this is a refactor and existing tests cover
correctness. Tests that might fail include:

Test: storage/indexeddb/index-count.html
Test: storage/indexeddb/objectstore-count.html
Test: storage/indexeddb/database-basics.html

* Modules/indexeddb/IDBCallbacks.h:
(IDBCallbacks):
* Modules/indexeddb/IDBCursorBackendImpl.cpp:
(WebCore::IDBCursorBackendImpl::advanceInternal):
(WebCore::IDBCursorBackendImpl::continueFunctionInternal):
(WebCore::IDBCursorBackendImpl::prefetchContinueInternal):
* Modules/indexeddb/IDBCursorBackendImpl.h:
(WebCore::IDBCursorBackendImpl::value):
* Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
(WebCore::IDBDatabaseBackendImpl::deleteDatabase):
* Modules/indexeddb/IDBIndex.cpp:
* Modules/indexeddb/IDBIndexBackendImpl.cpp:
(WebCore::IDBIndexBackendImpl::openCursorInternal):
(WebCore::IDBIndexBackendImpl::countInternal):
(WebCore::IDBIndexBackendImpl::getInternal):
* Modules/indexeddb/IDBObjectStore.cpp:
* Modules/indexeddb/IDBObjectStoreBackendImpl.cpp:
(WebCore::IDBObjectStoreBackendImpl::getInternal):
(WebCore::IDBObjectStoreBackendImpl::deleteInternal):
(WebCore::IDBObjectStoreBackendImpl::clearInternal):
(WebCore::IDBObjectStoreBackendImpl::openCursorInternal):
(WebCore::IDBObjectStoreBackendImpl::countInternal):
* Modules/indexeddb/IDBRequest.cpp:
(WebCore::IDBRequest::onSuccess):
(WebCore):
* Modules/indexeddb/IDBRequest.h:
* Modules/indexeddb/IDBTransaction.cpp:
* Modules/indexeddb/IDBTransactionBackendImpl.cpp:
* Modules/indexeddb/IDBTransactionBackendImpl.h:
* Modules/indexeddb/IDBTransactionBackendInterface.h:
* bindings/v8/IDBBindingUtilities.cpp:
(WebCore::deserializeIDBValue):
* inspector/InspectorIndexedDBAgent.cpp:
(WebCore):

Source/WebKit/chromium:

Hook up new undefined/integer-based onSuccess handlers.

* src/IDBCallbacksProxy.cpp:
(WebKit::IDBCallbacksProxy::onSuccess):
(WebKit):
* src/IDBCallbacksProxy.h:
(IDBCallbacksProxy):
* src/WebIDBCallbacksImpl.cpp:
(WebKit::WebIDBCallbacksImpl::onSuccess):
(WebKit):
* src/WebIDBCallbacksImpl.h:
(WebIDBCallbacksImpl):
* tests/IDBAbortOnCorruptTest.cpp:
* tests/IDBDatabaseBackendTest.cpp:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@131661 268f45cc-cd09-0410-ab3c-d52691b4dbfc
24 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Modules/indexeddb/IDBCallbacks.h
Source/WebCore/Modules/indexeddb/IDBCursorBackendImpl.cpp
Source/WebCore/Modules/indexeddb/IDBCursorBackendImpl.h
Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.cpp
Source/WebCore/Modules/indexeddb/IDBIndex.cpp
Source/WebCore/Modules/indexeddb/IDBIndexBackendImpl.cpp
Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp
Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendImpl.cpp
Source/WebCore/Modules/indexeddb/IDBRequest.cpp
Source/WebCore/Modules/indexeddb/IDBRequest.h
Source/WebCore/Modules/indexeddb/IDBTransaction.cpp
Source/WebCore/Modules/indexeddb/IDBTransactionBackendImpl.cpp
Source/WebCore/Modules/indexeddb/IDBTransactionBackendImpl.h
Source/WebCore/Modules/indexeddb/IDBTransactionBackendInterface.h
Source/WebCore/bindings/v8/IDBBindingUtilities.cpp
Source/WebCore/inspector/InspectorIndexedDBAgent.cpp
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/src/IDBCallbacksProxy.cpp
Source/WebKit/chromium/src/IDBCallbacksProxy.h
Source/WebKit/chromium/src/WebIDBCallbacksImpl.cpp
Source/WebKit/chromium/src/WebIDBCallbacksImpl.h
Source/WebKit/chromium/tests/IDBAbortOnCorruptTest.cpp
Source/WebKit/chromium/tests/IDBDatabaseBackendTest.cpp