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

Unified Diff: third_party/WebKit/Source/bindings/templates/interface_base.cpp.tmpl

Issue 2460423002: Use new LazyDataProperty API for DOM constructors (Closed)
Patch Set: updates Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/bindings/templates/interface_base.cpp.tmpl
diff --git a/third_party/WebKit/Source/bindings/templates/interface_base.cpp.tmpl b/third_party/WebKit/Source/bindings/templates/interface_base.cpp.tmpl
index 0f9744bdcef8aea0ab3eb9ab6bc50b8f58166fa8..65e9821eb4a4042be246a8cbd92eac330fc93899 100644
--- a/third_party/WebKit/Source/bindings/templates/interface_base.cpp.tmpl
+++ b/third_party/WebKit/Source/bindings/templates/interface_base.cpp.tmpl
@@ -230,6 +230,27 @@ const V8DOMConfiguration::AttributeConfiguration {{v8_class}}Attributes[] = {
{% endif %}
{% endblock %}
{##############################################################################}
+{% block install_lazy_data_attributes %}
+{% from 'attributes.cpp.tmpl' import attribute_configuration with context %}
+{% if attributes | has_lazy_data_attribute_configuration %}
+// Suppress warning: global constructors, because AttributeConfiguration is trivial
+// and does not depend on another global objects.
+#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG)
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wglobal-constructors"
+#endif
+const V8DOMConfiguration::AttributeConfiguration {{v8_class}}LazyDataAttributes[] = {
+ {% for attribute in attributes | has_lazy_data_attribute_configuration %}
+ {{attribute_configuration(attribute)}},
+ {% endfor %}
+};
+#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG)
+#pragma clang diagnostic pop
+#endif
+
+{% endif %}
+{% endblock %}
+{##############################################################################}
{% block install_accessors %}
{% from 'attributes.cpp.tmpl' import attribute_configuration with context %}
{% if attributes | has_accessor_configuration %}
@@ -305,6 +326,9 @@ static void install{{v8_class}}Template(v8::Isolate* isolate, const DOMWrapperWo
{% if attributes | has_attribute_configuration %}
V8DOMConfiguration::installAttributes(isolate, world, instanceTemplate, prototypeTemplate, {{'%sAttributes' % v8_class}}, {{'WTF_ARRAY_LENGTH(%sAttributes)' % v8_class}});
{% endif %}
+ {% if attributes | has_lazy_data_attribute_configuration %}
+ V8DOMConfiguration::installLazyDataAttributes(isolate, world, instanceTemplate, prototypeTemplate, {{'%sLazyDataAttributes' % v8_class}}, {{'WTF_ARRAY_LENGTH(%sLazyDataAttributes)' % v8_class}});
+ {% endif %}
{% if attributes | has_accessor_configuration %}
V8DOMConfiguration::installAccessors(isolate, world, instanceTemplate, prototypeTemplate, interfaceTemplate, signature, {{'%sAccessors' % v8_class}}, {{'WTF_ARRAY_LENGTH(%sAccessors)' % v8_class}});
{% endif %}

Powered by Google App Engine
This is Rietveld 408576698