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

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: Addressed review comments. 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
« no previous file with comments | « Source/bindings/scripts/v8_utilities.py ('k') | Source/bindings/templates/interface.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 %}
+{% set property_location_list = property_location_list + ['V8DOMConfiguration::OnPrototype'] %}
+{% endif %}
+{% if attribute.on_interface %}
+{% 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,
] %}
-{% 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 %}
« no previous file with comments | « Source/bindings/scripts/v8_utilities.py ('k') | Source/bindings/templates/interface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698