IndexedDB onupgradeneeded event has incorrect value for oldVersion.
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 Jun 2015 00:17:32 +0000 (00:17 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 Jun 2015 00:17:32 +0000 (00:17 +0000)
commitbb7412164235a472bec6531bcedbf83d0d9a46c7
treea47686fb2f60594f7fd7ee1fa59195008dddf838
parent3eff66c7e8438b4bd0f1895f65e6b55a419f508e
IndexedDB onupgradeneeded event has incorrect value for oldVersion.
<rdar://problem/18309792> and https://bugs.webkit.org/show_bug.cgi?id=136888

Reviewed by Sam Weinig.

Source/WebCore:

Test: storage/indexeddb/version-change-event-basic.html

"NoIntVersion" is an internal bookkeeping concept that we never should've been passing to Javascript.

This cleans up things by:
- Adjusting an old version of "NoIntVersion" to "0" before making the version change callback.
- Removing the VersionNullness parameter from almost everywhere.
- Removing the nullability of the newVersion parameter from the IDL.

* Modules/indexeddb/IDBDatabase.cpp:
(WebCore::IDBDatabase::onVersionChange):
* Modules/indexeddb/IDBDatabase.h:

* Modules/indexeddb/IDBDatabaseBackend.cpp:
(WebCore::IDBDatabaseBackend::runIntVersionChangeTransaction):
(WebCore::IDBDatabaseBackend::deleteDatabase):

* Modules/indexeddb/IDBDatabaseCallbacks.h:
* Modules/indexeddb/IDBDatabaseCallbacksImpl.cpp:
(WebCore::IDBDatabaseCallbacksImpl::onVersionChange):
* Modules/indexeddb/IDBDatabaseCallbacksImpl.h:

* Modules/indexeddb/IDBOpenDBRequest.cpp:
(WebCore::IDBOpenDBRequest::onBlocked):
(WebCore::IDBOpenDBRequest::onUpgradeNeeded):

* Modules/indexeddb/IDBTransactionBackendOperations.cpp:
(WebCore::IDBDatabaseBackend::VersionChangeOperation::perform):

* Modules/indexeddb/IDBVersionChangeEvent.cpp:
(WebCore::IDBVersionChangeEvent::IDBVersionChangeEvent):
* Modules/indexeddb/IDBVersionChangeEvent.h:
(WebCore::IDBVersionChangeEvent::create):
(WebCore::IDBVersionChangeEvent::newVersion):
* Modules/indexeddb/IDBVersionChangeEvent.idl:

LayoutTests:

* storage/indexeddb/version-change-event-basic-expected.txt: Added.
* storage/indexeddb/version-change-event-basic.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@185480 268f45cc-cd09-0410-ab3c-d52691b4dbfc
15 files changed:
LayoutTests/ChangeLog
LayoutTests/storage/indexeddb/version-change-event-basic-expected.txt [new file with mode: 0644]
LayoutTests/storage/indexeddb/version-change-event-basic.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/Modules/indexeddb/IDBDatabase.cpp
Source/WebCore/Modules/indexeddb/IDBDatabase.h
Source/WebCore/Modules/indexeddb/IDBDatabaseBackend.cpp
Source/WebCore/Modules/indexeddb/IDBDatabaseCallbacks.h
Source/WebCore/Modules/indexeddb/IDBDatabaseCallbacksImpl.cpp
Source/WebCore/Modules/indexeddb/IDBDatabaseCallbacksImpl.h
Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.cpp
Source/WebCore/Modules/indexeddb/IDBTransactionBackendOperations.cpp
Source/WebCore/Modules/indexeddb/IDBVersionChangeEvent.cpp
Source/WebCore/Modules/indexeddb/IDBVersionChangeEvent.h
Source/WebCore/Modules/indexeddb/IDBVersionChangeEvent.idl