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

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

Issue 24867002: Add static attributes to IDL compiler (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Reupload Created 7 years, 2 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
1 {% extends 'interface_base.cpp' %} 1 {% extends 'interface_base.cpp' %}
2 2
3 3
4 {##############################################################################} 4 {##############################################################################}
5 {% block class_attributes %} 5 {% block class_attributes %}
6 {# FIXME: rename to install_attributes and put into configure_class_template #} 6 {# FIXME: rename to install_attributes and put into configure_class_template #}
7 {% if attributes %} 7 {% if attributes %}
8 static const V8DOMConfiguration::AttributeConfiguration {{v8_class_name}}Attribu tes[] = { 8 static const V8DOMConfiguration::AttributeConfiguration {{v8_class_name}}Attribu tes[] = {
9 {% for attribute in attributes %} 9 {% for attribute in attributes if attribute.is_normal %}
10 {"{{attribute.name}}", {{cpp_class_name}}V8Internal::{{attribute.name}}Attri buteGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), sta tic_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 10 {"{{attribute.name}}", {{cpp_class_name}}V8Internal::{{attribute.name}}Attri buteGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), sta tic_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
11 {% endfor %} 11 {% endfor %}
12 }; 12 };
13 13
14 {% endif %} 14 {% endif %}
15 {% endblock %} 15 {% endblock %}
16 16
17 17
18 {##############################################################################} 18 {##############################################################################}
19 {% block configure_class_template %} 19 {% block configure_class_template %}
20 {# FIXME: rename to install_dom_template and Install{{v8_class_name}}DOMTemplate #} 20 {# FIXME: rename to install_dom_template and Install{{v8_class_name}}DOMTemplate #}
21 static v8::Handle<v8::FunctionTemplate> Configure{{v8_class_name}}Template(v8::H andle<v8::FunctionTemplate> desc, v8::Isolate* isolate, WrapperWorldType current WorldType) 21 static v8::Handle<v8::FunctionTemplate> Configure{{v8_class_name}}Template(v8::H andle<v8::FunctionTemplate> desc, v8::Isolate* isolate, WrapperWorldType current WorldType)
22 { 22 {
23 desc->ReadOnlyPrototype(); 23 desc->ReadOnlyPrototype();
24 24
25 v8::Local<v8::Signature> defaultSignature; 25 v8::Local<v8::Signature> defaultSignature;
26 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(desc, "{{inte rface_name}}", v8::Local<v8::FunctionTemplate>(), {{v8_class_name}}::internalFie ldCount, 26 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(desc, "{{inte rface_name}}", v8::Local<v8::FunctionTemplate>(), {{v8_class_name}}::internalFie ldCount,
27 {{attribute_templates}}, {{number_of_attributes}}, 27 {{attribute_templates}}, {{number_of_attributes}},
28 0, 0, isolate, currentWorldType); 28 0, 0, isolate, currentWorldType);
29 UNUSED_PARAM(defaultSignature); 29 UNUSED_PARAM(defaultSignature);
30 {% for attribute in attributes if attribute.is_static %}
31 // Attribute '{{attribute.name}}' (Extended Attributes: '{{attribute.extende d_attributes | join(' ')}}')
32 desc->SetNativeDataProperty(v8::String::NewSymbol("{{attribute.name}}"), {{c pp_class_name}}V8Internal::{{attribute.name}}AttributeGetterCallback, 0, v8::Ext ernal::New(0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::Acce ssorSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT));
33 {% endfor %}
30 {% if constants %}{# In general more checks than just constants #} 34 {% if constants %}{# In general more checks than just constants #}
31 v8::Local<v8::ObjectTemplate> instance = desc->InstanceTemplate(); 35 v8::Local<v8::ObjectTemplate> instance = desc->InstanceTemplate();
32 v8::Local<v8::ObjectTemplate> proto = desc->PrototypeTemplate(); 36 v8::Local<v8::ObjectTemplate> proto = desc->PrototypeTemplate();
33 UNUSED_PARAM(instance); 37 UNUSED_PARAM(instance);
34 UNUSED_PARAM(proto); 38 UNUSED_PARAM(proto);
35 {% endif %} 39 {% endif %}
36 {% if constants %} 40 {% if constants %}
37 {{install_constants() | indent}} 41 {{install_constants() | indent}}
38 {% endif %} 42 {% endif %}
39 43
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 V8DOMWrapper::associateObjectWithWrapper<{{v8_class_name}}>(impl, &info, wra pper, isolate, WrapperConfiguration::Independent); 134 V8DOMWrapper::associateObjectWithWrapper<{{v8_class_name}}>(impl, &info, wra pper, isolate, WrapperConfiguration::Independent);
131 return wrapper; 135 return wrapper;
132 } 136 }
133 137
134 void {{v8_class_name}}::derefObject(void* object) 138 void {{v8_class_name}}::derefObject(void* object)
135 { 139 {
136 fromInternalPointer(object)->deref(); 140 fromInternalPointer(object)->deref();
137 } 141 }
138 142
139 {% endblock %} 143 {% endblock %}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698