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

Unified Diff: Source/bindings/templates/attributes.cpp

Issue 1181113006: bindings: Introduces on_{instance,prototype,interface} in the code generator. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: Source/bindings/templates/attributes.cpp
diff --git a/Source/bindings/templates/attributes.cpp b/Source/bindings/templates/attributes.cpp
index e5a17b06a86846b959e08804fdd23574e67d3164..46359d78a0687f6e6c8c96d61aa9ad3fe5ed475e 100644
--- a/Source/bindings/templates/attributes.cpp
+++ b/Source/bindings/templates/attributes.cpp
@@ -528,9 +528,17 @@ bool {{v8_class}}::PrivateScript::{{attribute.name}}AttributeSetter(LocalFrame*
'V8DOMConfiguration::OnlyExposedToPrivateScript'
if attribute.only_exposed_to_private_script else
'V8DOMConfiguration::ExposedToAllScripts' %}
-{% set on_prototype = 'V8DOMConfiguration::OnPrototype'
- if interface_name == 'Window' and attribute.idl_type == 'EventHandler'
- else 'V8DOMConfiguration::OnInstance' %}
+{% set property_location_list = [] %}
+{% if attribute.on_instance %}
+{% set property_location_list = property_location_list + ['V8DOMConfiguration::OnInstance'] %}
+{% endif %}
+{% if attribute.on_prototype %}
haraken 2015/06/17 16:31:21 if => elif ?
+{% set property_location_list = property_location_list + ['V8DOMConfiguration::OnPrototype'] %}
+{% endif %}
+{% if attribute.on_interface %}
haraken 2015/06/17 16:31:21 if => elif ? Maybe it would be better to use attr
Yuki 2015/06/18 07:44:41 I intend to make property_location bitflags. One
+{% set property_location_list = property_location_list + ['V8DOMConfiguration::OnInterface'] %}
+{% endif %}
+{% set property_location = property_location_list | join(' | ') %}
{% set holder_check = 'V8DOMConfiguration::DoNotCheckHolder'
if attribute.is_lenient_this else 'V8DOMConfiguration::CheckHolder' %}
{% set attribute_configuration_list = [
@@ -543,13 +551,8 @@ bool {{v8_class}}::PrivateScript::{{attribute.name}}AttributeSetter(LocalFrame*
access_control,
property_attribute,
only_exposed_to_private_script,
+ property_location,
+ holder_check,
haraken 2015/06/17 16:31:21 alphabetical order
bashi 2015/06/18 02:16:27 These are for AttributeConfiguration struct so we
] %}
-{% if attribute.is_expose_js_accessors %}
-{% set attribute_configuration_list = attribute_configuration_list
- + [holder_check] %}
-{% else %}
-{% set attribute_configuration_list = attribute_configuration_list
- + [on_prototype] %}
-{% endif %}
{{'{'}}{{attribute_configuration_list | join(', ')}}{{'}'}}
{%- endmacro %}

Powered by Google App Engine
This is Rietveld 408576698