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

Issue 2891063003: bindings: Use an alias for @@iterator in certain declarations. (Closed)

Created:
3 years, 7 months ago by Raphael Kubo da Costa (rakuco)
Modified:
3 years, 7 months ago
Reviewers:
haraken, meade_UTC10, bashi, Yuki
CC:
chromium-reviews, blink-reviews, blink-reviews-w3ctests_chromium.org, blink-reviews-bindings_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

bindings: Use an alias for @@iterator in certain declarations. So far, the generated bindings had completely separate methods for entries(), values() and the @@iterator symbol, all of which were added automatically if an IDL has an iterable<>, maplike<> or setlike<> declaration. However, the WebIDL spec states that: * Pair iterators (iterable<K,V>) and maplike declarations (maplike<K,V>) should add the same Function object for both @@iterator and entries(), and its name attribute should be "entries". * Setlike declarations (setlike<V>) should add the same Function object for both @@iterator and values(), and its name attribute should be "values". Fix it by adding SymbolKeyedMethodConfiguration::symbol_alias, an optional string that can be used to add the same function template as both a symbol as well as this string (which will also be used as the Function object's name attribute). While here, bring back a simpler version of the ValueIterable class removed in commit c85bc0151 ("bindings: Make some value iterator properties aliases to Array.prototype functions") and call it SetlikeIterable instead. As the name suggests, we need it for interfaces with setlike declarations instead of "iterable<V>" declarations: the latter uses the definitions from %ArrayPrototype%, while the former do not. SetlikeIterable is currently used by FontFaceSet, which is our only IDL with a setlike declaration and whose C++ implementation was previously inheriting from PairIterable, leading @@iterator to call entriesForBinding() instead of valuesForBinding() instead. BUG=723648 R=bashi@chromium.org,haraken@chromium.org,yukishiino@chromium.org Review-Url: https://codereview.chromium.org/2891063003 Cr-Commit-Position: refs/heads/master@{#473558} Committed: https://chromium.googlesource.com/chromium/src/+/1bd6e150922b18cd1fa5e0f14482ecf691ba3377

Patch Set 1 #

Patch Set 2 : Fix failing tests, add SetlikeIterable #

Total comments: 2

Patch Set 3 : Make methods_context() return a dict #

Patch Set 4 : Rebase patch #

Unified diffs Side-by-side diffs Delta from patch set Stats (+87 lines, -140 lines) Patch
D third_party/WebKit/LayoutTests/external/wpt/fetch/api/headers/headers-idl-expected.txt View 1 1 chunk +0 lines, -34 lines 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/Iterable.h View 1 2 chunks +15 lines, -1 line 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/V8DOMConfiguration.h View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/V8DOMConfiguration.cpp View 4 chunks +36 lines, -12 lines 0 comments Download
M third_party/WebKit/Source/bindings/scripts/v8_interface.py View 1 2 5 chunks +26 lines, -7 lines 0 comments Download
M third_party/WebKit/Source/bindings/templates/interface_base.cpp.tmpl View 1 chunk +3 lines, -1 line 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface.h View 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface.cpp View 4 chunks +1 line, -20 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface2.h View 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface2.cpp View 4 chunks +1 line, -20 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceGarbageCollected.h View 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceGarbageCollected.cpp View 4 chunks +1 line, -20 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.h View 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp View 4 chunks +1 line, -20 lines 0 comments Download
M third_party/WebKit/Source/core/css/FontFaceSet.h View 1 2 chunks +2 lines, -1 line 0 comments Download

Messages

Total messages: 22 (13 generated)
Raphael Kubo da Costa (rakuco)
PTAL
3 years, 7 months ago (2017-05-19 14:54:50 UTC) #3
haraken
LGTM
3 years, 7 months ago (2017-05-20 00:03:36 UTC) #8
bashi
lgtm https://codereview.chromium.org/2891063003/diff/20001/third_party/WebKit/Source/bindings/scripts/v8_interface.py File third_party/WebKit/Source/bindings/scripts/v8_interface.py (right): https://codereview.chromium.org/2891063003/diff/20001/third_party/WebKit/Source/bindings/scripts/v8_interface.py#newcode751 third_party/WebKit/Source/bindings/scripts/v8_interface.py:751: return methods, iterator_method, iterator_method_alias nit: I'd prefer to ...
3 years, 7 months ago (2017-05-21 23:27:48 UTC) #9
Raphael Kubo da Costa (rakuco)
https://codereview.chromium.org/2891063003/diff/20001/third_party/WebKit/Source/bindings/scripts/v8_interface.py File third_party/WebKit/Source/bindings/scripts/v8_interface.py (right): https://codereview.chromium.org/2891063003/diff/20001/third_party/WebKit/Source/bindings/scripts/v8_interface.py#newcode751 third_party/WebKit/Source/bindings/scripts/v8_interface.py:751: return methods, iterator_method, iterator_method_alias On 2017/05/21 23:27:48, bashi wrote: ...
3 years, 7 months ago (2017-05-22 09:29:52 UTC) #10
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/2891063003/40001
3 years, 7 months ago (2017-05-22 09:30:21 UTC) #13
commit-bot: I haz the power
Try jobs failed on following builders: ios-device on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device/builds/215873) ios-device-xcode-clang on master.tryserver.chromium.mac (JOB_FAILED, ...
3 years, 7 months ago (2017-05-22 09:32:31 UTC) #15
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/2891063003/60001
3 years, 7 months ago (2017-05-22 10:11:56 UTC) #18
commit-bot: I haz the power
Committed patchset #4 (id:60001) as https://chromium.googlesource.com/chromium/src/+/1bd6e150922b18cd1fa5e0f14482ecf691ba3377
3 years, 7 months ago (2017-05-22 12:48:54 UTC) #21
Yuki
3 years, 7 months ago (2017-05-22 13:05:17 UTC) #22
Message was sent while issue was closed.
LGTM.

Powered by Google App Engine
This is Rietveld 408576698