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

Issue 938733003: IDL: Fix exception handling when converting V8 value to union/dictionary (Closed)

Created:
5 years, 10 months ago by Jens Widell
Modified:
5 years, 9 months ago
Reviewers:
haraken, bashi
CC:
blink-reviews, blink-reviews-bindings_chromium.org, vivekg_samsung, arv+blink, vivekg
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

IDL: Fix exception handling when converting V8 value to union/dictionary The toImpl() functions generated for union and dictionary types should report exceptions via their ExceptionState argument. But internally, they were doing value conversions using the TONATIVE_VOID_EXCEPTIONSTATE(), TONATIVE_VOID_EXCEPTIONSTATE_ARGINTERNAL() and TOSTRING_VOID() macros, that always throw exceptions all the way to V8 (in the TONATIVE_*() cases by calling exceptionState.throwIfNeeded().) To fix this, introduce _NOTHROW variants of the TONATIVE_*() macros, that end with if (exceptionState.hadException()) return; instead of if (exceptionState.throwIfNeeded()) return; and use those instead, and use TOSTRING_VOID_EXCEPTIONSTATE() instead of TOSTRING_VOID(). TOSTRING_VOID_EXCEPTIONSTATE(), unlike the TONATIVE_*_EXCEPTIONSTATE() macros, does not throw exceptions all the way to V8, but rather leaves them in the ExceptionState object. BUG=240176, 321462

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+51 lines, -30 lines) Patch
M Source/bindings/core/v8/V8BindingMacros.h View 1 chunk +11 lines, -0 lines 0 comments Download
M Source/bindings/scripts/v8_dictionary.py View 1 chunk +2 lines, -1 line 0 comments Download
M Source/bindings/scripts/v8_types.py View 3 chunks +10 lines, -2 lines 0 comments Download
M Source/bindings/scripts/v8_union.py View 1 chunk +2 lines, -1 line 0 comments Download
M Source/bindings/tests/results/core/UnionTypesCore.cpp View 9 chunks +10 lines, -10 lines 0 comments Download
M Source/bindings/tests/results/core/V8TestDictionary.cpp View 13 chunks +13 lines, -13 lines 0 comments Download
M Source/bindings/tests/results/core/V8TestDictionaryDerived.cpp View 2 chunks +2 lines, -2 lines 0 comments Download
M Source/bindings/tests/results/core/V8TestInterfaceEventInit.cpp View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 3 (1 generated)
Jens Widell
PTAL Needless to say, these macros are getting out of hand... This problem is contributing ...
5 years, 10 months ago (2015-02-23 13:17:07 UTC) #2
haraken
5 years, 10 months ago (2015-02-23 13:48:42 UTC) #3
On 2015/02/23 13:17:07, Jens Widell wrote:
> PTAL
> 
> Needless to say, these macros are getting out of hand...
> 
> This problem is contributing to the unit test failures in PS#1 of
> https://codereview.chromium.org/947923002/. The unit tests are calling
toImpl()
> with a TrackExceptionState, on which calling throwException()/throwIfNeeded()
is
> effectively illegal, because none of the throw*Error() functions actually
throw
> an exception (which throwExecption() asserts must have been done.)

The complexity of these macros is getting unacceptable... I'm sorry to say this
without any alternative ideas, but we might want to spend time in fixing the
issue without messing up the macros :-/

Powered by Google App Engine
This is Rietveld 408576698