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

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: Re-reupload Created 7 years, 3 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 reflected_name instead of name #}
3 {% macro class_constants() %}
4 static const V8DOMConfiguration::ConstantConfiguration {{v8_class_name}}Constant s[] = {
5 {% for constant in constants %}
6 {% if not constant.enabled_at_runtime %}
7 {% if constant.conditional_string %}
8 #if {{constant.conditional_string}}
9 {% endif %}
10 {"{{constant.name}}", {{constant.value}}},
11 {% if constant.conditional_string %}
12 #endif // {{constant.conditional_string}}
13 {% endif %}
14 {% endif %}{# not constant.enabled_at_runtime #}
15 {% endfor %}
16 };
17 {% if not do_not_check_constants %}
18
19 {% for constant in constants %}
20 {% if constant.conditional_string %}
21 #if {{constant.conditional_string}}
22 {% endif %}
23 {# FIXME
24 {{cpp_class_name}}Enum{{constant.name_reflect}}IsWrongUseDoNotCheckConstants
25 =>
26 TheValueOf{{cpp_class_name}}::{{constant.name_reflect}}Doesn'tMatchWithImplement ation
27 #}
28 COMPILE_ASSERT({{constant.value}} == {{cpp_class_name}}::{{constant.reflected_na me}}, {{cpp_class_name}}Enum{{constant.reflected_name}}IsWrongUseDoNotCheckConst ants);
29 {% if constant.conditional_string %}
30 #endif // {{constant.conditional_string}}
31 {% endif %}
32 {% endfor %}
33 {% endif %}{# not do_not_check_constants #}
34 {% endmacro %}
35
36
37 {##############################################################################}
38 {% macro install_constants() %}
39 {# Runtime-enabled constants #}
40 {% for constant in constants %}
41 {% if constant.enabled_at_runtime %}
42 {% if constant.conditional_string %}
43 #if {{constant.conditional_string}}
44 {% endif %}
45 if ({{constant.runtime_enable_function_name}}()) {
46 static const V8DOMConfiguration::ConstantConfiguration constantConfigura tion = {"{{constant.name}}", static_cast<signed int>({{constant.value}})};
47 V8DOMConfiguration::installConstants(desc, proto, &constantConfiguration , 1, isolate);
48 }
49 {% if constant.conditional_string %}
50 #endif // {{constant.conditional_string}}
51 {%- endif %}
52 {% endif %}
53 {% endfor %}
54 {# Normal (always enabled) constants #}
55 V8DOMConfiguration::installConstants(desc, proto, {{v8_class_name}}Constants , WTF_ARRAY_LENGTH({{v8_class_name}}Constants), isolate);
56 {%- endmacro %}
OLDNEW
« no previous file with comments | « Source/bindings/templates/callback_interface.cpp ('k') | Source/bindings/templates/interface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698