Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(896)

Issue 11184033: Merge 131658 - IndexedDB: Enforce unsigned long/unsigned long long ranges (Closed)

Created:
8 years, 2 months ago by jsbell
Modified:
8 years, 2 months ago
Reviewers:
jsbell
CC:
chromium-reviews
Base URL:
http://svn.webkit.org/repository/webkit/branches/chromium/1271/
Visibility:
Public.

Description

Merge 131658 - IndexedDB: Enforce unsigned long/unsigned long long ranges https://bugs.webkit.org/show_bug.cgi?id=99637 Reviewed by Tony Chang. Source/WebCore: The IndexedDB spec has [EnforceRange] specified on unsigned long and unsigned long long arguments, which requires the implementation to throw TypeError for negative values or values that exceed 2^53-1 (maximum JS number that behaves like an integer) - and 0 is specifically forbidden by the APIs as well. A more correct fix in the binding layer is in webkit.org/b/96798 but we can temporarily address this in the implementation. Also refactor to prevent IDBFactory.open(name, -1) from triggering an internal code path. Tests: storage/indexeddb/cursor-advance.html storage/indexeddb/intversion-bad-parameters.html storage/indexeddb/intversion-encoding.html * Modules/indexeddb/IDBCursor.cpp: (WebCore::IDBCursor::advance): Validate argument range. * Modules/indexeddb/IDBCursor.h: (IDBCursor): * Modules/indexeddb/IDBCursor.idl: Drop "unsigned" qualifier as the binding code is not yet doing the correct validation. * Modules/indexeddb/IDBFactory.cpp: Refactor to prevent open(name, -1) (WebCore): (WebCore::IDBFactory::open): Validate the int version here, then pass to... (WebCore::IDBFactory::openInternal): ... this method. * Modules/indexeddb/IDBFactory.h: (IDBFactory): * Modules/indexeddb/IDBFactory.idl: Drop "unsigned" qualifier; meaningless to binding code right now, can be re-added once webkit.org/b/96798 lands. LayoutTests: Additional edge case tests and updated expectations. * storage/indexeddb/cursor-advance-expected.txt: * storage/indexeddb/intversion-bad-parameters-expected.txt: * storage/indexeddb/intversion-encoding-expected.txt: * storage/indexeddb/resources/cursor-advance.js: (testBadAdvance.advanceBadly): (testBadAdvance): * storage/indexeddb/resources/intversion-bad-parameters.js: (deleteSuccess): * storage/indexeddb/resources/intversion-encoding.js: TBR=jsbell@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=131669

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+38 lines, -23 lines) Patch
M LayoutTests/storage/indexeddb/cursor-advance-expected.txt View 1 chunk +6 lines, -0 lines 0 comments Download
M LayoutTests/storage/indexeddb/intversion-bad-parameters-expected.txt View 1 chunk +6 lines, -5 lines 0 comments Download
M LayoutTests/storage/indexeddb/intversion-encoding-expected.txt View 1 chunk +1 line, -1 line 0 comments Download
A + LayoutTests/storage/indexeddb/open-bad-versions.html View 0 chunks +-1 lines, --1 lines 0 comments Download
A + LayoutTests/storage/indexeddb/open-bad-versions-expected.txt View 0 chunks +-1 lines, --1 lines 0 comments Download
M LayoutTests/storage/indexeddb/resources/cursor-advance.js View 1 chunk +2 lines, -0 lines 0 comments Download
M LayoutTests/storage/indexeddb/resources/intversion-bad-parameters.js View 1 chunk +3 lines, -7 lines 0 comments Download
M LayoutTests/storage/indexeddb/resources/intversion-encoding.js View 1 chunk +1 line, -1 line 0 comments Download
M Source/WebCore/Modules/indexeddb/IDBCursor.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/WebCore/Modules/indexeddb/IDBCursor.cpp View 2 chunks +4 lines, -2 lines 0 comments Download
M Source/WebCore/Modules/indexeddb/IDBCursor.idl View 1 chunk +1 line, -1 line 0 comments Download
M Source/WebCore/Modules/indexeddb/IDBFactory.h View 1 chunk +2 lines, -0 lines 0 comments Download
M Source/WebCore/Modules/indexeddb/IDBFactory.cpp View 2 chunks +11 lines, -5 lines 0 comments Download
M Source/WebCore/Modules/indexeddb/IDBFactory.idl View 1 chunk +2 lines, -2 lines 0 comments Download

Messages

Total messages: 1 (0 generated)
jsbell
8 years, 2 months ago (2012-10-17 23:52:50 UTC) #1

          

Powered by Google App Engine
This is Rietveld 408576698