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

Issue 121113004: Improve handling of failed integer type conversions. (Closed)

Created:
6 years, 11 months ago by sof
Modified:
6 years, 11 months ago
CC:
blink-reviews, kojih, arv+blink, jsbell+bindings_chromium.org, abarth-chromium, marja+watch_chromium.org, adamk+blink_chromium.org, Nate Chapin, watchdog-blink-watchlist_google.com, Inactive, kouhei (in TOK)
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Visibility:
Public.

Description

Improve handling of failed integer type conversions. Change over the V8Binding methods for converting to integer types (to*Int*()) to take an ExceptionState argument instead of using a bool reference argument to indicate success/failure. Improve the exception messages from failed type conversion as a result; adjust the binding code generator to emit compatible calls and exception propagation. Reworked some of the error reporting in the WebGL custom binding code while switching over; more informative exception messages will now flow. R=jsbell,nbarth,haraken BUG= Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=164568

Patch Set 1 #

Patch Set 2 : Update expected outputs #

Total comments: 5

Patch Set 3 : Update new IDL compiler to match #

Total comments: 13

Patch Set 4 : Clean up handling of integer types a bit #

Patch Set 5 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1279 lines, -851 lines) Patch
M LayoutTests/fast/canvas/webgl/bad-arguments-test-expected.txt View 2 chunks +14 lines, -14 lines 0 comments Download
M LayoutTests/fast/canvas/webgl/gl-object-get-calls-expected.txt View 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/fast/dom/exception-in-binding.html View 1 chunk +34 lines, -43 lines 0 comments Download
M LayoutTests/fast/dom/exception-in-binding-expected.txt View 1 chunk +4 lines, -6 lines 0 comments Download
M LayoutTests/fast/js/webidl-type-mapping-expected.txt View 20 chunks +102 lines, -102 lines 0 comments Download
M LayoutTests/storage/indexeddb/cursor-advance-expected.txt View 1 1 chunk +4 lines, -4 lines 0 comments Download
M LayoutTests/storage/indexeddb/cursor-advance-workers-expected.txt View 1 1 chunk +4 lines, -4 lines 0 comments Download
M LayoutTests/storage/indexeddb/exceptions-expected.txt View 1 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/storage/indexeddb/intversion-bad-parameters-expected.txt View 1 1 chunk +8 lines, -8 lines 0 comments Download
M LayoutTests/virtual/gpu/fast/canvas/webgl/gl-object-get-calls-expected.txt View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/bindings/scripts/code_generator_v8.pm View 1 2 3 4 19 chunks +89 lines, -73 lines 0 comments Download
M Source/bindings/scripts/unstable/v8_attributes.py View 1 2 3 chunks +14 lines, -6 lines 0 comments Download
M Source/bindings/scripts/unstable/v8_methods.py View 1 2 3 4 2 chunks +5 lines, -7 lines 0 comments Download
M Source/bindings/scripts/unstable/v8_types.py View 1 2 3 5 chunks +18 lines, -10 lines 0 comments Download
M Source/bindings/templates/attributes.cpp View 1 2 3 4 1 chunk +1 line, -2 lines 0 comments Download
M Source/bindings/tests/results/V8TestEventTarget.cpp View 1 2 3 4 1 chunk +4 lines, -2 lines 0 comments Download
M Source/bindings/tests/results/V8TestInterface.cpp View 1 2 3 4 1 chunk +3 lines, -2 lines 0 comments Download
M Source/bindings/tests/results/V8TestInterfaceCheckSecurity.cpp View 1 2 3 4 2 chunks +4 lines, -2 lines 0 comments Download
M Source/bindings/tests/results/V8TestInterfaceNamedConstructor.cpp View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M Source/bindings/tests/results/V8TestObject.cpp View 1 2 3 4 83 chunks +255 lines, -130 lines 0 comments Download
M Source/bindings/tests/results/V8TestObjectPython.cpp View 1 2 3 4 81 chunks +229 lines, -118 lines 0 comments Download
M Source/bindings/tests/results/V8TestTypedefs.cpp View 1 2 3 4 3 chunks +5 lines, -3 lines 0 comments Download
M Source/bindings/v8/Dictionary.h View 1 2 3 4 2 chunks +24 lines, -28 lines 0 comments Download
M Source/bindings/v8/ExceptionState.h View 1 chunk +11 lines, -1 line 0 comments Download
M Source/bindings/v8/ExceptionState.cpp View 1 chunk +18 lines, -0 lines 0 comments Download
M Source/bindings/v8/V8Binding.h View 1 2 3 4 2 chunks +53 lines, -54 lines 0 comments Download
M Source/bindings/v8/V8Binding.cpp View 1 2 3 4 14 chunks +91 lines, -48 lines 0 comments Download
M Source/bindings/v8/V8BindingMacros.h View 2 chunks +40 lines, -36 lines 0 comments Download
M Source/bindings/v8/custom/V8BiquadFilterNodeCustom.cpp View 3 chunks +11 lines, -6 lines 0 comments Download
M Source/bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp View 2 chunks +5 lines, -7 lines 0 comments Download
M Source/bindings/v8/custom/V8OscillatorNodeCustom.cpp View 3 chunks +11 lines, -5 lines 0 comments Download
M Source/bindings/v8/custom/V8PannerNodeCustom.cpp View 4 chunks +21 lines, -12 lines 0 comments Download
M Source/bindings/v8/custom/V8PromiseCustom.cpp View 1 chunk +2 lines, -3 lines 0 comments Download
M Source/bindings/v8/custom/V8WebGLRenderingContextCustom.cpp View 18 chunks +187 lines, -106 lines 0 comments Download
M Source/modules/indexeddb/IDBCursor.cpp View 1 2 chunks +4 lines, -5 lines 0 comments Download

Messages

Total messages: 12 (0 generated)
sof
Please take a look when you next have a moment. While I haven't intentionally tried ...
6 years, 11 months ago (2014-01-02 12:01:28 UTC) #1
jsbell
modules/indexeddb (and corresponding tests) lgtm. I skimmed but did not throughly review the code generator ...
6 years, 11 months ago (2014-01-02 18:03:22 UTC) #2
sof
https://codereview.chromium.org/121113004/diff/200001/Source/bindings/tests/results/V8TestObject.cpp File Source/bindings/tests/results/V8TestObject.cpp (right): https://codereview.chromium.org/121113004/diff/200001/Source/bindings/tests/results/V8TestObject.cpp#newcode246 Source/bindings/tests/results/V8TestObject.cpp:246: ExceptionState exceptionState(ExceptionState::SetterContext, "byteAttr", "TestObject", info.Holder(), info.GetIsolate()); On 2014/01/02 18:03:23, ...
6 years, 11 months ago (2014-01-02 19:30:30 UTC) #3
sof
jsbell writes: > .. > re: testing the python generator: run-bindings-tests --test-python Great, thanks. I've ...
6 years, 11 months ago (2014-01-02 20:53:48 UTC) #4
Nils Barth (inactive)
On 2014/01/02 20:53:48, sof wrote: > jsbell writes: > > > .. > > re: ...
6 years, 11 months ago (2014-01-06 02:54:16 UTC) #5
Nils Barth (inactive)
Comments on CG changes; main one is to have an INTEGER_TYPES set (instead of using ...
6 years, 11 months ago (2014-01-06 02:58:08 UTC) #6
sof
https://codereview.chromium.org/121113004/diff/280001/Source/bindings/scripts/code_generator_v8.pm File Source/bindings/scripts/code_generator_v8.pm (right): https://codereview.chromium.org/121113004/diff/280001/Source/bindings/scripts/code_generator_v8.pm#newcode175 Source/bindings/scripts/code_generator_v8.pm:175: my %integerTypeHash = ("byte" => "Int8", On 2014/01/06 02:58:09, ...
6 years, 11 months ago (2014-01-06 21:01:24 UTC) #7
Nils Barth (inactive)
Thanks for revisions, CG part looks great! https://codereview.chromium.org/121113004/diff/280001/Source/bindings/scripts/unstable/v8_types.py File Source/bindings/scripts/unstable/v8_types.py (right): https://codereview.chromium.org/121113004/diff/280001/Source/bindings/scripts/unstable/v8_types.py#newcode388 Source/bindings/scripts/unstable/v8_types.py:388: elif is_integer_type(idl_type): ...
6 years, 11 months ago (2014-01-07 02:11:35 UTC) #8
haraken
LGTM but I'm a bit concerned that this might regress performance. Integer conversion can be ...
6 years, 11 months ago (2014-01-07 02:19:04 UTC) #9
sof
On 2014/01/07 02:19:04, haraken wrote: > LGTM but I'm a bit concerned that this might ...
6 years, 11 months ago (2014-01-07 07:11:48 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/sigbjornf@opera.com/121113004/410001
6 years, 11 months ago (2014-01-07 09:56:45 UTC) #11
commit-bot: I haz the power
6 years, 11 months ago (2014-01-07 12:37:10 UTC) #12
Message was sent while issue was closed.
Change committed as 164568

Powered by Google App Engine
This is Rietveld 408576698