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

Side by Side Diff: Source/bindings/templates/constants.cpp

Issue 23068032: Add constants and primitive type readonly attributes to Python IDL compiler (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 {# FIXME: remove all the conditional_string blocks once test removed #}
2 {# FIXME: should use name_reflect instead of name #}
3 {# FIXME: do we need separate value and value_raw? #}
4 {% macro class_consts() %}
haraken 2013/08/22 07:31:33 class_consts => define_constants
Nils Barth (inactive) 2013/08/22 09:08:13 (See above.)
5 static const V8DOMConfiguration::BatchedConstant {{v8_class_name}}Consts[] = {
haraken 2013/08/22 07:31:33 {{v8_class_name}}Consts[] => {{v8_class_name}}Cons
Nils Barth (inactive) 2013/08/22 09:08:13 (Perl.)
6 {% for constant in constants %}
7 {% if not constant.enabled_at_runtime %}
8 {% if constant.conditional_string %}
9 #if {{constant.conditional_string}}
10 {% endif %}
11 {"{{constant.name}}", {{constant.value}}},
12 {% if constant.conditional_string %}
13 #endif // {{constant.conditional_string}}
14 {% endif %}
15 {% endif %}{# not constant.enabled_at_runtime #}
16 {% endfor %}
17 };
18 {% if not do_not_check_constants %}
19
20
haraken 2013/08/22 07:31:33 Nit: Unnecessary empty line.
Nils Barth (inactive) 2013/08/22 09:08:13 (Perl.)
21 {% for constant in constants %}
22 {% if constant.conditional_string %}
23 #if {{constant.conditional_string}}
24 {% endif %}
25 COMPILE_ASSERT({{constant.value_raw}} == {{cpp_class_name}}::{{constant.name_ref lect}}, {{cpp_class_name}}Enum{{constant.name_reflect}}IsWrongUseDoNotCheckConst ants);
haraken 2013/08/22 07:31:33 {{cpp_class_name}}Enum{{constant.name_reflect}}IsW
Nils Barth (inactive) 2013/08/22 09:08:13 Perl. ...and should: Doesn'tMatchWithImplementatio
26 {% if constant.conditional_string %}
27 #endif // {{constant.conditional_string}}
28 {% endif %}
29 {% endfor %}
30 {% endif %}{# not do_not_check_constants #}
31 {% endmacro %}{# class_consts #}
32
33
34 {##############################################################################}
35 {% macro const_data(constant) %}
haraken 2013/08/22 07:31:33 const_data => install_runtime_enabled_constant
Nils Barth (inactive) 2013/08/22 09:08:13 (See above.)
36 {% if constant.enabled_at_runtime %}
37 {% if constant.conditional_string %}
38 #if {{constant.conditional_string}}
39 {% endif %}
40 if ({{constant.enable_function}}()) {
41 static const V8DOMConfiguration::BatchedConstant constData = {"{{constan t.name}}", static_cast<signed int>({{constant.value}})};
haraken 2013/08/22 07:31:33 constData => constantConfiguration ?
Nils Barth (inactive) 2013/08/22 09:08:13 I *think* the "Configuration" is just for initiali
haraken 2013/08/22 11:05:28 This is used just for initialization. That's the r
Nils Barth (inactive) 2013/08/23 01:50:05 Got it, will do!
42 V8DOMConfiguration::batchConfigureConstants(desc, proto, &constData, 1, isolate);
43 }
44 {% if constant.conditional_string %}
45 #endif // {{constant.conditional_string}}
46 {%- endif %}
haraken 2013/08/22 07:31:33 Ditto. What is the '-' ?
Nils Barth (inactive) 2013/08/22 09:08:13 It removes trailing whitespace; I'm using it here
47 {% endif %}
48 {% endmacro %}{# const_data #}
49
50
51 {##############################################################################}
52 {% macro batch_configure_constants() %}
haraken 2013/08/22 07:31:33 batch_configure_constants => install_constants
Nils Barth (inactive) 2013/08/22 09:08:13 (See above.)
53 V8DOMConfiguration::batchConfigureConstants(desc, proto, {{v8_class_name}}Consts , WTF_ARRAY_LENGTH({{v8_class_name}}Consts), isolate);
haraken 2013/08/22 07:31:33 Probably we want to rename the method to installCo
Nils Barth (inactive) 2013/08/22 09:08:13 FIXME added!
54 {%- endmacro %}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698