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

Issue 1047993002: bindings: Add validation for enum Sequence or Array (Closed)

Created:
5 years, 8 months ago by bashi
Modified:
5 years, 8 months ago
Reviewers:
haraken
CC:
blink-reviews, blink-reviews-bindings_chromium.org, vivekg_samsung, arv+blink, Inactive, vivekg
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

bindings: Add validation for enum Sequence or Array We should throw a TypeError when an invalid enum value is passed as an element of Sequence or Array. BUG=471967 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=192987

Patch Set 1 #

Total comments: 9

Patch Set 2 : #

Total comments: 4

Patch Set 3 : #

Total comments: 1

Patch Set 4 : #

Patch Set 5 : #

Patch Set 6 : #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+317 lines, -187 lines) Patch
M LayoutTests/fast/canvas/canvas-hit-regions-fill-rule-test-expected.txt View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/fast/canvas/canvas-isPointInPath-winding-expected.txt View 1 2 3 1 chunk +8 lines, -8 lines 0 comments Download
M LayoutTests/fast/canvas/canvas-path-context-clip-expected.txt View 1 2 3 4 1 chunk +6 lines, -6 lines 0 comments Download
M LayoutTests/fast/canvas/canvas-path-context-fill-expected.txt View 1 2 3 4 1 chunk +6 lines, -6 lines 0 comments Download
M LayoutTests/fast/canvas/winding-enumeration-expected.txt View 1 2 3 4 1 chunk +3 lines, -3 lines 0 comments Download
M LayoutTests/fast/dom/Window/window-scroll-arguments-expected.txt View 1 2 3 4 3 chunks +9 lines, -9 lines 0 comments Download
M LayoutTests/fast/dom/domparser-parsefromstring-mimetype-support-expected.txt View 1 2 3 4 1 chunk +4 lines, -4 lines 0 comments Download
M LayoutTests/fast/dom/idl-dictionary-unittest.html View 1 4 chunks +4 lines, -0 lines 0 comments Download
M LayoutTests/fast/dom/idl-dictionary-unittest-expected.txt View 1 2 3 4 3 chunks +4 lines, -1 line 0 comments Download
M LayoutTests/fast/dom/idl-union-type-unittest-expected.txt View 1 2 3 4 1 chunk +4 lines, -4 lines 0 comments Download
M LayoutTests/fast/mediastream/RTCSessionDescription-expected.txt View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/fast/xmlhttprequest/xmlhttprequest-set-responsetype-expected.txt View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M LayoutTests/http/tests/media/media-source/mediasource-sourcebuffer-mode-expected.txt View 1 2 3 4 5 1 chunk +4 lines, -4 lines 0 comments Download
M LayoutTests/inspector/layers/layer-canvas-log-expected.txt View 1 2 3 4 5 6 chunks +19 lines, -19 lines 0 comments Download
M LayoutTests/media/track/track-addtrack-kind-expected.txt View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/media/track/track-cue-mutable-expected.txt View 1 2 3 4 5 2 chunks +3 lines, -3 lines 0 comments Download
M LayoutTests/media/track/track-mode-expected.txt View 1 2 3 4 5 1 chunk +2 lines, -2 lines 0 comments Download
M LayoutTests/storage/indexeddb/exceptions-expected.txt View 1 2 3 4 5 4 chunks +4 lines, -4 lines 0 comments Download
M LayoutTests/storage/indexeddb/index-basics-expected.txt View 1 2 3 4 5 2 chunks +2 lines, -2 lines 0 comments Download
M LayoutTests/storage/indexeddb/index-basics-workers-expected.txt View 1 2 3 4 5 2 chunks +2 lines, -2 lines 0 comments Download
M LayoutTests/storage/indexeddb/objectstore-keycursor-expected.txt View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/storage/indexeddb/transaction-basics-expected.txt View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/storage/quota/storagequota-query-info-expected.txt View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/virtual/gpu/fast/canvas/canvas-path-context-clip-expected.txt View 1 2 3 4 5 1 chunk +6 lines, -6 lines 0 comments Download
M LayoutTests/virtual/gpu/fast/canvas/canvas-path-context-fill-expected.txt View 1 2 3 4 5 1 chunk +6 lines, -6 lines 0 comments Download
M LayoutTests/webaudio/biquadfilternode-basic-expected.txt View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/webaudio/dom-exceptions-expected.txt View 1 2 3 4 5 1 chunk +5 lines, -5 lines 0 comments Download
M LayoutTests/webaudio/oscillator-basic-expected.txt View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/webaudio/pannernode-basic-expected.txt View 1 2 3 4 5 1 chunk +2 lines, -2 lines 0 comments Download
M Source/bindings/core/v8/V8Binding.h View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download
M Source/bindings/core/v8/V8Binding.cpp View 1 2 3 1 chunk +19 lines, -0 lines 0 comments Download
M Source/bindings/scripts/idl_types.py View 2 chunks +5 lines, -1 line 0 comments Download
M Source/bindings/scripts/v8_attributes.py View 2 chunks +2 lines, -2 lines 0 comments Download
M Source/bindings/scripts/v8_dictionary.py View 1 chunk +1 line, -1 line 0 comments Download
M Source/bindings/scripts/v8_methods.py View 1 2 3 4 5 2 chunks +2 lines, -3 lines 0 comments Download
M Source/bindings/scripts/v8_types.py View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M Source/bindings/scripts/v8_union.py View 1 chunk +1 line, -1 line 0 comments Download
M Source/bindings/scripts/v8_utilities.py View 2 chunks +0 lines, -11 lines 0 comments Download
M Source/bindings/templates/attributes.cpp View 1 2 3 2 chunks +8 lines, -5 lines 0 comments Download
M Source/bindings/templates/conversions.cpp View 1 1 chunk +9 lines, -0 lines 0 comments Download
M Source/bindings/templates/dictionary_v8.cpp View 1 2 3 2 chunks +4 lines, -5 lines 0 comments Download
M Source/bindings/templates/methods.cpp View 1 2 3 2 chunks +6 lines, -7 lines 0 comments Download
M Source/bindings/templates/union.cpp View 1 2 3 3 chunks +8 lines, -8 lines 0 comments Download
M Source/bindings/tests/idls/core/TestDictionary.idl View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M Source/bindings/tests/results/core/TestDictionary.h View 1 2 2 chunks +5 lines, -0 lines 0 comments Download
M Source/bindings/tests/results/core/UnionTypesCore.cpp View 1 2 3 2 chunks +15 lines, -6 lines 0 comments Download
M Source/bindings/tests/results/core/V8TestDictionary.cpp View 1 2 3 2 chunks +33 lines, -4 lines 0 comments Download
M Source/bindings/tests/results/core/V8TestInterface.cpp View 1 2 3 4 5 4 chunks +27 lines, -10 lines 1 comment Download
M Source/bindings/tests/results/core/V8TestObject.cpp View 1 2 3 4 5 5 chunks +38 lines, -13 lines 0 comments Download
M Source/bindings/tests/results/modules/V8TestInterfacePartial.cpp View 1 2 3 2 chunks +9 lines, -4 lines 0 comments Download
M Source/core/testing/DictionaryTest.h View 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/testing/DictionaryTest.cpp View 3 chunks +5 lines, -0 lines 0 comments Download
M Source/core/testing/InternalDictionary.idl View 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 18 (2 generated)
bashi
What do you think about this fix? This is not an ideal fix but should ...
5 years, 8 months ago (2015-03-31 04:32:25 UTC) #2
haraken
The approach looks good. https://codereview.chromium.org/1047993002/diff/1/Source/bindings/templates/attributes.cpp File Source/bindings/templates/attributes.cpp (right): https://codereview.chromium.org/1047993002/diff/1/Source/bindings/templates/attributes.cpp#newcode337 Source/bindings/templates/attributes.cpp:337: if (!isValidEnum(cppValue, validValues, {{attribute.enum_values|length}})) { ...
5 years, 8 months ago (2015-03-31 06:11:17 UTC) #3
bashi
Thanks! https://codereview.chromium.org/1047993002/diff/1/Source/bindings/templates/conversions.cpp File Source/bindings/templates/conversions.cpp (right): https://codereview.chromium.org/1047993002/diff/1/Source/bindings/templates/conversions.cpp#newcode35 Source/bindings/templates/conversions.cpp:35: const char* validValues[] = { On 2015/03/31 06:11:16, ...
5 years, 8 months ago (2015-04-01 00:17:31 UTC) #4
haraken
V8StringResource has an implicit conversion to a WTF::String, so we might want to use the ...
5 years, 8 months ago (2015-04-01 00:29:46 UTC) #5
bashi
> V8StringResource has an implicit conversion to a WTF::String, so we might want > to ...
5 years, 8 months ago (2015-04-01 00:50:57 UTC) #6
haraken
https://codereview.chromium.org/1047993002/diff/40001/Source/bindings/tests/results/core/V8TestDictionary.cpp File Source/bindings/tests/results/core/V8TestDictionary.cpp (right): https://codereview.chromium.org/1047993002/diff/40001/Source/bindings/tests/results/core/V8TestDictionary.cpp#newcode164 Source/bindings/tests/results/core/V8TestDictionary.cpp:164: exceptionState.throwTypeError("member enumSequenceMember ('" + toCoreString(isolate, enumSequenceMemberValue) + "') is ...
5 years, 8 months ago (2015-04-01 01:27:25 UTC) #7
bashi
On 2015/04/01 01:27:25, haraken wrote: > https://codereview.chromium.org/1047993002/diff/40001/Source/bindings/tests/results/core/V8TestDictionary.cpp > File Source/bindings/tests/results/core/V8TestDictionary.cpp (right): > > https://codereview.chromium.org/1047993002/diff/40001/Source/bindings/tests/results/core/V8TestDictionary.cpp#newcode164 > ...
5 years, 8 months ago (2015-04-01 01:48:42 UTC) #8
haraken
On 2015/04/01 01:48:42, bashi1 wrote: > On 2015/04/01 01:27:25, haraken wrote: > > > https://codereview.chromium.org/1047993002/diff/40001/Source/bindings/tests/results/core/V8TestDictionary.cpp ...
5 years, 8 months ago (2015-04-01 02:02:54 UTC) #9
bashi
On 2015/04/01 02:02:54, haraken wrote: > On 2015/04/01 01:48:42, bashi1 wrote: > > On 2015/04/01 ...
5 years, 8 months ago (2015-04-01 02:19:31 UTC) #10
haraken
On 2015/04/01 02:19:31, bashi1 wrote: > On 2015/04/01 02:02:54, haraken wrote: > > On 2015/04/01 ...
5 years, 8 months ago (2015-04-01 02:25:00 UTC) #11
bashi
Done. Using exceptionState without adding extra handling also drops some information. If this looks OK, ...
5 years, 8 months ago (2015-04-01 03:08:30 UTC) #12
haraken
LGTM
5 years, 8 months ago (2015-04-01 03:38:03 UTC) #13
bashi
Updated test expectations. https://codereview.chromium.org/1047993002/diff/100001/Source/bindings/tests/results/core/V8TestInterface.cpp File Source/bindings/tests/results/core/V8TestInterface.cpp (right): https://codereview.chromium.org/1047993002/diff/100001/Source/bindings/tests/results/core/V8TestInterface.cpp#newcode280 Source/bindings/tests/results/core/V8TestInterface.cpp:280: ExceptionState exceptionState(ExceptionState::SetterContext, "testEnumAttribute", "TestInterface", holder, info.GetIsolate()); ...
5 years, 8 months ago (2015-04-01 08:25:34 UTC) #14
haraken
On 2015/04/01 08:25:34, bashi1 wrote: > Updated test expectations. > > https://codereview.chromium.org/1047993002/diff/100001/Source/bindings/tests/results/core/V8TestInterface.cpp > File Source/bindings/tests/results/core/V8TestInterface.cpp ...
5 years, 8 months ago (2015-04-01 08:28:33 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1047993002/100001
5 years, 8 months ago (2015-04-02 01:28:34 UTC) #17
commit-bot: I haz the power
5 years, 8 months ago (2015-04-02 02:39:04 UTC) #18
Message was sent while issue was closed.
Committed patchset #6 (id:100001) as
https://src.chromium.org/viewvc/blink?view=rev&revision=192987

Powered by Google App Engine
This is Rietveld 408576698