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

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

Issue 17572008: WIP IDL compiler rewrite (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: Branch: const + primitive type readonly attributes 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
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() %}
5 static const V8DOMConfiguration::BatchedConstant {{v8_class_name}}Consts[] = {
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
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);
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 {% macro const_data(constant) %}
35 {% if constant.enabled_at_runtime %}
36 {% if constant.conditional_string %}
37 #if {{constant.conditional_string}}
38 {% endif %}
39 if ({{constant.enable_function}}()) {
40 static const V8DOMConfiguration::BatchedConstant constData = {"{{constan t.name}}", static_cast<signed int>({{constant.value}})};
41 V8DOMConfiguration::batchConfigureConstants(desc, proto, &constData, 1, isolate);
42 }
43 {% if constant.conditional_string %}
44 #endif // {{constant.conditional_string}}
45 {%- endif %}
46 {% endif %}
47 {% endmacro %}{# const_data #}
48
49
50 {% macro batch_configure_constants() %}
51 V8DOMConfiguration::batchConfigureConstants(desc, proto, {{v8_class_name}}Consts , WTF_ARRAY_LENGTH({{v8_class_name}}Consts), isolate);
52 {%- endmacro %}
OLDNEW
« no previous file with comments | « Source/bindings/templates/callback_interface.cpp ('k') | Source/bindings/templates/constructors.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698