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

Issue 299203002: Support per-overload [RuntimeEnabled] extended attribute (Closed)

Created:
6 years, 7 months ago by Jens Widell
Modified:
6 years, 6 months ago
CC:
blink-reviews, blink-reviews-bindings_chromium.org, arv+blink, abarth-chromium
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Visibility:
Public.

Description

IDL: support per-overload [RuntimeEnabled] extended attribute If different overloads of a method have different [RuntimeEnabled] extended attributes, check the runtime flags as part of overload resolution instead of when configuring the prototype object template. If the runtime feature is disabled, the overload resolution algorithm will act as if the method did not exist. If all overloads have the same [RuntimeEnabled] extended attribute, it is checked when configured the prototype object template as for regular non-overloaded methods. BUG=339000 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=176028

Patch Set 1 #

Total comments: 18

Patch Set 2 : #

Total comments: 1

Patch Set 3 : rebased #

Patch Set 4 : refactor runtime_enabled() filtering #

Total comments: 2

Patch Set 5 : rebased #

Patch Set 6 : rebased #

Total comments: 9

Patch Set 7 : address nits #

Patch Set 8 : move comment #

Total comments: 6
Unified diffs Side-by-side diffs Delta from patch set Stats (+190 lines, -24 lines) Patch
M Source/bindings/scripts/code_generator_v8.py View 1 2 1 chunk +3 lines, -2 lines 0 comments Download
M Source/bindings/scripts/v8_interface.py View 1 2 3 4 5 3 chunks +3 lines, -3 lines 0 comments Download
M Source/bindings/templates/interface.cpp View 1 2 3 4 5 6 2 chunks +5 lines, -7 lines 0 comments Download
M Source/bindings/templates/methods.cpp View 1 2 3 4 5 6 7 2 chunks +4 lines, -1 line 0 comments Download
M Source/bindings/tests/idls/TestObject.idl View 1 2 3 4 5 6 1 chunk +5 lines, -0 lines 0 comments Download
M Source/bindings/tests/results/V8TestInterface.cpp View 1 2 3 4 5 1 chunk +12 lines, -6 lines 0 comments Download
M Source/bindings/tests/results/V8TestObject.cpp View 1 2 3 4 5 6 6 chunks +158 lines, -5 lines 6 comments Download

Messages

Total messages: 34 (0 generated)
Jens Widell
PTAL. This affects some existing methods in CanvasRenderingContext2D: fill, stroke, clip, isPointInPath, isPointInStroke and drawImage, ...
6 years, 7 months ago (2014-05-23 14:49:44 UTC) #1
Jens Widell
https://codereview.chromium.org/299203002/diff/1/Source/bindings/scripts/v8_interface.py File Source/bindings/scripts/v8_interface.py (right): https://codereview.chromium.org/299203002/diff/1/Source/bindings/scripts/v8_interface.py#newcode709 Source/bindings/scripts/v8_interface.py:709: # Stop here unless this overload (and not all ...
6 years, 7 months ago (2014-05-23 14:55:16 UTC) #2
Nils Barth (inactive)
LGTM, with a few style and comment points. Thanks, this is a long-desired feature! You ...
6 years, 7 months ago (2014-05-27 06:33:19 UTC) #3
Jens Widell
https://codereview.chromium.org/299203002/diff/1/Source/bindings/scripts/v8_interface.py File Source/bindings/scripts/v8_interface.py (right): https://codereview.chromium.org/299203002/diff/1/Source/bindings/scripts/v8_interface.py#newcode357 Source/bindings/scripts/v8_interface.py:357: runtime_enabled_features = set(method.get('runtime_enabled_function') On 2014/05/27 06:33:20, Nils Barth wrote: ...
6 years, 7 months ago (2014-05-27 06:46:19 UTC) #4
Nils Barth (inactive)
Thanks for comments; get() is fine, but we should make the treatment uniform with [DeprecateAs] ...
6 years, 7 months ago (2014-05-27 07:24:17 UTC) #5
Jens Widell
https://codereview.chromium.org/299203002/diff/1/Source/bindings/scripts/v8_interface.py File Source/bindings/scripts/v8_interface.py (right): https://codereview.chromium.org/299203002/diff/1/Source/bindings/scripts/v8_interface.py#newcode359 Source/bindings/scripts/v8_interface.py:359: if len(runtime_enabled_features) > 1: On 2014/05/27 07:24:17, Nils Barth ...
6 years, 7 months ago (2014-05-27 07:39:16 UTC) #6
Jens Widell
https://codereview.chromium.org/299203002/diff/1/Source/bindings/scripts/v8_interface.py File Source/bindings/scripts/v8_interface.py (right): https://codereview.chromium.org/299203002/diff/1/Source/bindings/scripts/v8_interface.py#newcode359 Source/bindings/scripts/v8_interface.py:359: if len(runtime_enabled_features) > 1: On 2014/05/27 07:39:17, Jens Lindström ...
6 years, 7 months ago (2014-05-27 07:42:15 UTC) #7
Nils Barth (inactive)
Thanks for tweaking! Bit confused about what issues you're running into... https://codereview.chromium.org/299203002/diff/1/Source/bindings/scripts/v8_interface.py File Source/bindings/scripts/v8_interface.py (right): ...
6 years, 7 months ago (2014-05-27 07:50:42 UTC) #8
Jens Widell
On 2014/05/27 07:50:42, Nils Barth wrote: > https://codereview.chromium.org/299203002/diff/1/Source/bindings/scripts/v8_interface.py#newcode359 > Source/bindings/scripts/v8_interface.py:359: if len(runtime_enabled_features) > > 1: ...
6 years, 7 months ago (2014-05-27 07:55:31 UTC) #9
Nils Barth (inactive)
On 2014/05/27 07:55:31, Jens Lindström wrote: > On 2014/05/27 07:50:42, Nils Barth wrote: > > ...
6 years, 7 months ago (2014-05-27 08:02:12 UTC) #10
Jens Widell
On 2014/05/27 08:02:12, Nils Barth wrote: > Hmm...can't we use something like: > {% set ...
6 years, 7 months ago (2014-05-27 08:04:58 UTC) #11
Nils Barth (inactive)
On 2014/05/27 08:04:58, Jens Lindström wrote: > On 2014/05/27 08:02:12, Nils Barth wrote: > > ...
6 years, 7 months ago (2014-05-27 08:08:35 UTC) #12
Jens Widell
On 2014/05/27 07:39:16, Jens Lindström wrote: > {% if not method.overload_index or method.overload_index == 1 ...
6 years, 7 months ago (2014-05-27 08:17:07 UTC) #13
Nils Barth (inactive)
On 2014/05/27 08:17:07, Jens Lindström wrote: > If the first and last method overloads have ...
6 years, 7 months ago (2014-05-27 08:19:01 UTC) #14
Jens Widell
On 2014/05/27 08:19:01, Nils Barth wrote: > To keep this CL simple(-ish), could you fix ...
6 years, 7 months ago (2014-05-27 08:22:10 UTC) #15
Nils Barth (inactive)
On 2014/05/27 08:22:10, Jens Lindström wrote: > (Thanks for great reviewing, BTW!) (#^.^#) Thanks for ...
6 years, 7 months ago (2014-05-27 08:25:05 UTC) #16
Jens Widell
Updated to address review comments. Also change how 'do_not_check_signature' and 'do_generate_method_configuration' are handled on overloaded ...
6 years, 7 months ago (2014-05-27 13:55:24 UTC) #17
Jens Widell
Additional change in patch set 4: move runtime_enabled() filtering up to where conditional() filtering is ...
6 years, 6 months ago (2014-06-02 09:42:35 UTC) #18
Jens Widell
https://codereview.chromium.org/299203002/diff/60001/Source/bindings/templates/interface.cpp File Source/bindings/templates/interface.cpp (right): https://codereview.chromium.org/299203002/diff/60001/Source/bindings/templates/interface.cpp#newcode995 Source/bindings/templates/interface.cpp:995: {% filter runtime_enabled(method.overloads.runtime_enabled_function_all if method.overloads else This is wrong ...
6 years, 6 months ago (2014-06-04 11:20:28 UTC) #19
Justin Novosad
> junov: Can you confirm that "removing" these drawImage(ImageBitmap, ...) > overloads is safe? confirmed.
6 years, 6 months ago (2014-06-04 20:22:26 UTC) #20
Jens Widell
https://codereview.chromium.org/299203002/diff/60001/Source/bindings/templates/interface.cpp File Source/bindings/templates/interface.cpp (right): https://codereview.chromium.org/299203002/diff/60001/Source/bindings/templates/interface.cpp#newcode995 Source/bindings/templates/interface.cpp:995: {% filter runtime_enabled(method.overloads.runtime_enabled_function_all if method.overloads else On 2014/06/04 11:20:28, ...
6 years, 6 months ago (2014-06-05 08:51:50 UTC) #21
Jens Widell
Rebased onto r176017 (method registration fixes), which made this CL rather more trivial.
6 years, 6 months ago (2014-06-12 11:13:51 UTC) #22
Nils Barth (inactive)
LGTM; thanks for splitting off the technical issues into another CL! https://codereview.chromium.org/299203002/diff/100001/Source/bindings/templates/interface.cpp File Source/bindings/templates/interface.cpp (left): ...
6 years, 6 months ago (2014-06-12 11:45:06 UTC) #23
Nils Barth (inactive)
BTW, once this lands, could you post an announcement on blink-dev, as this has been ...
6 years, 6 months ago (2014-06-12 11:46:07 UTC) #24
Jens Widell
https://codereview.chromium.org/299203002/diff/100001/Source/bindings/templates/methods.cpp File Source/bindings/templates/methods.cpp (right): https://codereview.chromium.org/299203002/diff/100001/Source/bindings/templates/methods.cpp#newcode353 Source/bindings/templates/methods.cpp:353: {# 10. If i = d, then: #} On ...
6 years, 6 months ago (2014-06-12 12:04:38 UTC) #25
Nils Barth (inactive)
https://codereview.chromium.org/299203002/diff/100001/Source/bindings/templates/methods.cpp File Source/bindings/templates/methods.cpp (right): https://codereview.chromium.org/299203002/diff/100001/Source/bindings/templates/methods.cpp#newcode353 Source/bindings/templates/methods.cpp:353: {# 10. If i = d, then: #} On ...
6 years, 6 months ago (2014-06-12 12:20:27 UTC) #26
Jens Widell
The CQ bit was checked by jl@opera.com
6 years, 6 months ago (2014-06-12 12:49:50 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/jl@opera.com/299203002/160001
6 years, 6 months ago (2014-06-12 12:50:38 UTC) #28
haraken
LGTM https://codereview.chromium.org/299203002/diff/160001/Source/bindings/tests/results/V8TestObject.cpp File Source/bindings/tests/results/V8TestObject.cpp (right): https://codereview.chromium.org/299203002/diff/160001/Source/bindings/tests/results/V8TestObject.cpp#newcode6918 Source/bindings/tests/results/V8TestObject.cpp:6918: if (true) { This branch will never hit. ...
6 years, 6 months ago (2014-06-12 13:32:58 UTC) #29
Jens Widell
https://codereview.chromium.org/299203002/diff/160001/Source/bindings/tests/results/V8TestObject.cpp File Source/bindings/tests/results/V8TestObject.cpp (right): https://codereview.chromium.org/299203002/diff/160001/Source/bindings/tests/results/V8TestObject.cpp#newcode6918 Source/bindings/tests/results/V8TestObject.cpp:6918: if (true) { On 2014/06/12 13:32:57, haraken wrote: > ...
6 years, 6 months ago (2014-06-12 13:40:07 UTC) #30
haraken
https://codereview.chromium.org/299203002/diff/160001/Source/bindings/tests/results/V8TestObject.cpp File Source/bindings/tests/results/V8TestObject.cpp (right): https://codereview.chromium.org/299203002/diff/160001/Source/bindings/tests/results/V8TestObject.cpp#newcode6918 Source/bindings/tests/results/V8TestObject.cpp:6918: if (true) { On 2014/06/12 13:40:07, Jens Lindström wrote: ...
6 years, 6 months ago (2014-06-12 13:44:53 UTC) #31
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: win_blink_rel on tryserver.blink ...
6 years, 6 months ago (2014-06-12 13:57:55 UTC) #32
commit-bot: I haz the power
Change committed as 176028
6 years, 6 months ago (2014-06-12 14:33:05 UTC) #33
Nils Barth (inactive)
6 years, 6 months ago (2014-06-13 01:42:47 UTC) #34
Message was sent while issue was closed.
https://codereview.chromium.org/299203002/diff/160001/Source/bindings/tests/r...
File Source/bindings/tests/results/V8TestObject.cpp (right):

https://codereview.chromium.org/299203002/diff/160001/Source/bindings/tests/r...
Source/bindings/tests/results/V8TestObject.cpp:6918: if (true) {
On 2014/06/12 13:32:57, haraken wrote:
> This branch will never hit. Shall we use a better type so that all branches
hit?

This code is intentional, to keep the CG simpler.
This generated code is dead code, which is eliminated by the compiler,
so there's no impact on object code,
but generating this anyway avoids having to special-case this logic.

I initially had special cases that returned early, but the logic
got more complicated once we supported more cases, so Jens is
removing it.

(This code is generated whenever there are 2+ types that support
automatic type conversion at the distinguishing argument of
an overload.)

We *do* have special cases when it makes a difference though
(e.g., skip an IsNumber check if it's immediately followed by an
unconditional clause).

The comment in the CG is:

# (Perform automatic type conversion, in order. If any of these match,
# that’s the end, and no other tests are needed.) To keep this code simple,
# we rely on the C++ compiler's dead code elimination to deal with the
# redundancy if both cases below trigger.

See v8_interface.py in this CL for details:
https://codereview.chromium.org/299203002/diff/160001/Source/bindings/scripts...

Powered by Google App Engine
This is Rietveld 408576698