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

Issue 2301993002: binding: Introduces ExceptionToPromiseScope. (Closed)

Created:
4 years, 3 months ago by Yuki
Modified:
4 years, 3 months ago
Reviewers:
haraken, peria, bashi
CC:
chromium-reviews, blink-reviews, blink-reviews-bindings_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

binding: Introduces ExceptionToPromiseScope. ExceptionState is now a scope-like object, and guarantees that an exception is automatically thrown at destruction. ExceptionToPromiseScope similarly guarantees to return a reject promise instead of throwing an exception. A new Jinja2 filter "format_remove_duplicates" helps write a template more easily without caring duplicates. {% if A_enabled %} ScriptState* scriptState = ...; A(scriptState); {% endif %} {% if B_enabled %} ScriptState* scriptState = ...; B(scriptState); {% endif %} produces two lines of definitions of |scriptState|, however, format_remove_duplicates removes the duplicates. Jinja2 macro "propagate_error_with_exception_state" is no longer necessary, because ExceptionState and ExceptionToPromiseScope automatically throws an exception or returns a reject promise appropriately. This CL alone does not fix crbug.com/627309 , but the CL makes it easy to fix the issue. BUG=627309 Committed: https://crrev.com/afb9da1a91b0d1742a765b7a35f27e1be6645596 Cr-Commit-Position: refs/heads/master@{#418513}

Patch Set 1 #

Patch Set 2 : . #

Total comments: 12

Patch Set 3 : Fixes overloads' cases. #

Patch Set 4 : More fixes #

Patch Set 5 : throw_argument_error #

Patch Set 6 : Removed throwMinimumArityError family. #

Total comments: 4

Patch Set 7 : Synced. #

Patch Set 8 : Addressed review comments (rename, empty line). #

Unified diffs Side-by-side diffs Delta from patch set Stats (+3644 lines, -2746 lines) Patch
M third_party/WebKit/Source/bindings/core/v8/GeneratedCodeHelper.h View 1 2 3 4 5 6 7 1 chunk +30 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/scripts/code_generator_v8.py View 2 chunks +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/bindings/scripts/utilities.py View 1 2 3 4 5 6 7 3 chunks +42 lines, -1 line 0 comments Download
M third_party/WebKit/Source/bindings/templates/methods.cpp View 1 2 3 4 5 6 7 19 chunks +160 lines, -177 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestException.cpp View 1 2 3 4 5 6 2 chunks +8 lines, -6 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexed.cpp View 1 2 3 4 5 6 7 1 chunk +10 lines, -8 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexedGlobal.cpp View 1 2 3 4 5 6 7 1 chunk +10 lines, -8 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexedPrimaryGlobal.cpp View 1 2 3 4 5 6 7 1 chunk +10 lines, -8 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface.cpp View 1 2 3 4 5 6 7 57 chunks +203 lines, -133 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface2.cpp View 1 2 3 4 5 6 7 14 chunks +112 lines, -73 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface3.cpp View 1 2 3 4 5 6 7 7 chunks +42 lines, -22 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceCheckSecurity.cpp View 1 2 3 4 5 6 5 chunks +7 lines, -1 line 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor.cpp View 1 2 3 4 5 6 6 chunks +125 lines, -108 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor2.cpp View 1 2 3 4 5 6 4 chunks +68 lines, -62 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor3.cpp View 1 2 3 4 5 6 1 chunk +6 lines, -6 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor4.cpp View 1 2 3 4 5 6 2 chunks +12 lines, -12 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEventInitConstructor.cpp View 1 2 3 4 5 6 1 chunk +15 lines, -12 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEventTarget.cpp View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceGarbageCollected.cpp View 1 2 3 4 5 6 11 chunks +84 lines, -53 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNamedConstructor.cpp View 1 2 3 4 5 6 1 chunk +44 lines, -38 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNamedConstructor2.cpp View 1 2 3 4 5 6 1 chunk +7 lines, -6 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNode.cpp View 1 2 3 4 5 6 5 chunks +35 lines, -30 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceOriginTrialEnabled.cpp View 1 2 3 4 5 6 3 chunks +28 lines, -19 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceSecureContext.cpp View 1 2 3 4 5 6 6 chunks +6 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp View 1 2 3 4 5 6 7 296 chunks +2279 lines, -1746 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestSpecialOperations.cpp View 1 2 3 4 5 6 7 1 chunk +8 lines, -7 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestTypedefs.cpp View 1 2 3 4 5 6 9 chunks +74 lines, -60 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterface2Partial.cpp View 1 2 3 4 5 6 2 chunks +16 lines, -14 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterface5.cpp View 1 2 3 4 5 6 7 17 chunks +92 lines, -56 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterfacePartial.cpp View 1 2 3 4 5 6 7 9 chunks +108 lines, -79 lines 0 comments Download

Messages

Total messages: 53 (39 generated)
Yuki
Could you review this CL?
4 years, 3 months ago (2016-09-02 13:52:55 UTC) #9
haraken
https://codereview.chromium.org/2301993002/diff/20001/third_party/WebKit/Source/bindings/core/v8/GeneratedCodeHelper.cpp File third_party/WebKit/Source/bindings/core/v8/GeneratedCodeHelper.cpp (right): https://codereview.chromium.org/2301993002/diff/20001/third_party/WebKit/Source/bindings/core/v8/GeneratedCodeHelper.cpp#newcode30 third_party/WebKit/Source/bindings/core/v8/GeneratedCodeHelper.cpp:30: void throwMinimumArityError(ExceptionState& exceptionState, unsigned expected, unsigned actual) These helper ...
4 years, 3 months ago (2016-09-02 16:24:13 UTC) #12
Yuki
https://codereview.chromium.org/2301993002/diff/20001/third_party/WebKit/Source/bindings/core/v8/GeneratedCodeHelper.cpp File third_party/WebKit/Source/bindings/core/v8/GeneratedCodeHelper.cpp (right): https://codereview.chromium.org/2301993002/diff/20001/third_party/WebKit/Source/bindings/core/v8/GeneratedCodeHelper.cpp#newcode30 third_party/WebKit/Source/bindings/core/v8/GeneratedCodeHelper.cpp:30: void throwMinimumArityError(ExceptionState& exceptionState, unsigned expected, unsigned actual) On 2016/09/02 ...
4 years, 3 months ago (2016-09-05 07:19:25 UTC) #13
haraken
https://codereview.chromium.org/2301993002/diff/20001/third_party/WebKit/Source/bindings/core/v8/GeneratedCodeHelper.cpp File third_party/WebKit/Source/bindings/core/v8/GeneratedCodeHelper.cpp (right): https://codereview.chromium.org/2301993002/diff/20001/third_party/WebKit/Source/bindings/core/v8/GeneratedCodeHelper.cpp#newcode30 third_party/WebKit/Source/bindings/core/v8/GeneratedCodeHelper.cpp:30: void throwMinimumArityError(ExceptionState& exceptionState, unsigned expected, unsigned actual) On 2016/09/05 ...
4 years, 3 months ago (2016-09-05 08:24:22 UTC) #14
Yuki
Could you guys take another look?
4 years, 3 months ago (2016-09-08 15:24:04 UTC) #31
haraken
LGTM Regarding format_remove_duplicates, I'll delegate the decision to bashi-san (I'm slightly leaning toward to the ...
4 years, 3 months ago (2016-09-09 02:01:25 UTC) #34
peria
This CL seems to have many changes beside the introduction; e.g. refactoring, removing obsolete calls, ...
4 years, 3 months ago (2016-09-09 02:15:24 UTC) #35
bashi
As for format_remove_duplicates, I don't have a strong opinion and I'm OK with this if ...
4 years, 3 months ago (2016-09-12 23:41:20 UTC) #36
Yuki
Could you guys take another look? Renamed the class to ExceptionToRejectPromiseScope. https://codereview.chromium.org/2301993002/diff/100001/third_party/WebKit/Source/bindings/scripts/utilities.py File third_party/WebKit/Source/bindings/scripts/utilities.py (right): ...
4 years, 3 months ago (2016-09-14 07:10:59 UTC) #43
haraken
LGTM
4 years, 3 months ago (2016-09-14 07:12:47 UTC) #44
peria
lgtm
4 years, 3 months ago (2016-09-14 07:16:20 UTC) #45
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2301993002/140001
4 years, 3 months ago (2016-09-14 07:33:59 UTC) #49
commit-bot: I haz the power
Committed patchset #8 (id:140001)
4 years, 3 months ago (2016-09-14 08:46:20 UTC) #51
commit-bot: I haz the power
4 years, 3 months ago (2016-09-14 08:48:26 UTC) #53
Message was sent while issue was closed.
Patchset 8 (id:??) landed as
https://crrev.com/afb9da1a91b0d1742a765b7a35f27e1be6645596
Cr-Commit-Position: refs/heads/master@{#418513}

Powered by Google App Engine
This is Rietveld 408576698