IndexedDB: Handle generated keys up to 2^53
authorjsbell@chromium.org <jsbell@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 2 May 2012 23:03:42 +0000 (23:03 +0000)
committerjsbell@chromium.org <jsbell@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 2 May 2012 23:03:42 +0000 (23:03 +0000)
commitca7f22319775b0e081ec7f41bedf4881040833ed
tree1c261193917f21ac3335fa8cf78ce9e49f8e0088
parent348f089c3b44cfb3b07b79067c54acd98485f472
IndexedDB: Handle generated keys up to 2^53
https://bugs.webkit.org/show_bug.cgi?id=85114

Source/WebCore:

The spec defines the behavior for generated keys up to 2^53
(the maximum integer storable as an ECMAScript number) and
the error case when going beyond that. Ensure that we can
handle values up to that point and generate errors beyond.

Reviewed by Tony Chang.

Test: storage/indexeddb/key-generator.html

* Modules/indexeddb/IDBBackingStore.h:
(IDBBackingStore):
* Modules/indexeddb/IDBLevelDBBackingStore.cpp:
(WebCore::IDBLevelDBBackingStore::nextAutoIncrementNumber):
* Modules/indexeddb/IDBLevelDBBackingStore.h:
(IDBLevelDBBackingStore):
* Modules/indexeddb/IDBObjectStoreBackendImpl.cpp:
(WebCore::IDBObjectStoreBackendImpl::putInternal):
(WebCore::IDBObjectStoreBackendImpl::genAutoIncrementKey):
* Modules/indexeddb/IDBObjectStoreBackendImpl.h:
(IDBObjectStoreBackendImpl):

LayoutTests:

Reviewed by Tony Chang.

* storage/indexeddb/key-generator-expected.txt:
* storage/indexeddb/resources/key-generator.js:
(get defineTest):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@115902 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/storage/indexeddb/key-generator-expected.txt
LayoutTests/storage/indexeddb/resources/key-generator.js
Source/WebCore/ChangeLog
Source/WebCore/Modules/indexeddb/IDBBackingStore.h
Source/WebCore/Modules/indexeddb/IDBLevelDBBackingStore.cpp
Source/WebCore/Modules/indexeddb/IDBLevelDBBackingStore.h
Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendImpl.cpp
Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendImpl.h