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

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

Issue 1322533002: bindings: Supports to change the method location. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Addressed review comments. Created 5 years, 3 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/methods.cpp
diff --git a/Source/bindings/templates/methods.cpp b/Source/bindings/templates/methods.cpp
index c56051b877d8e72e6fc67e40ebdc7a87a7e5b881..07327ab2c894dd42cc946d0df31edf1772664de9 100644
--- a/Source/bindings/templates/methods.cpp
+++ b/Source/bindings/templates/methods.cpp
@@ -650,30 +650,24 @@ v8SetReturnValue(info, wrapper);
{##############################################################################}
{% macro method_configuration(method) %}
+{% from 'conversions.cpp' import property_location %}
{% set method_callback =
'%sV8Internal::%sMethodCallback' % (cpp_class_or_partial, method.name) %}
{% set method_callback_for_main_world =
'%sV8Internal::%sMethodCallbackForMainWorld' % (cpp_class_or_partial, method.name)
if method.is_per_world_bindings else '0' %}
{% set only_exposed_to_private_script = 'V8DOMConfiguration::OnlyExposedToPrivateScript' if method.only_exposed_to_private_script else 'V8DOMConfiguration::ExposedToAllScripts' %}
-{"{{method.name}}", {{method_callback}}, {{method_callback_for_main_world}}, {{method.length}}, {{only_exposed_to_private_script}}}
+{"{{method.name}}", {{method_callback}}, {{method_callback_for_main_world}}, {{method.length}}, {{only_exposed_to_private_script}}, {{property_location(method)}}}
{%- endmacro %}
{######################################}
-{% macro install_custom_signature(method) %}
-{% set method_callback = '%sV8Internal::%sMethodCallback' % (cpp_class_or_partial, method.name) %}
-{% set method_callback_for_main_world = '%sForMainWorld' % method_callback
- if method.is_per_world_bindings else '0' %}
-{% set method_length = method.overloads.length if method.overloads else method.length %}
+{% macro install_custom_signature(method, instance_template, prototype_template, interface_template, signature) %}
{% set property_attribute =
- 'static_cast<v8::PropertyAttribute>(%s)' % ' | '.join(method.property_attributes)
- if method.property_attributes else 'v8::None' %}
-{% set only_exposed_to_private_script = 'V8DOMConfiguration::OnlyExposedToPrivateScript' if method.only_exposed_to_private_script else 'V8DOMConfiguration::ExposedToAllScripts' %}
-const V8DOMConfiguration::MethodConfiguration {{method.name}}MethodConfiguration = {
- "{{method.name}}", {{method_callback}}, {{method_callback_for_main_world}}, {{method_length}}, {{only_exposed_to_private_script}},
-};
-V8DOMConfiguration::installMethod(isolate, {{method.function_template}}, {{method.signature}}, {{property_attribute}}, {{method.name}}MethodConfiguration);
+ 'static_cast<v8::PropertyAttribute>(%s)' % ' | '.join(method.property_attributes)
+ if method.property_attributes else 'v8::None' %}
+const V8DOMConfiguration::MethodConfiguration {{method.name}}MethodConfiguration = {{method_configuration(method)}};
+V8DOMConfiguration::installMethod(isolate, {{instance_template}}, {{prototype_template}}, {{interface_template}}, {{signature}}, {{property_attribute}}, {{method.name}}MethodConfiguration);
{%- endmacro %}
{######################################}
« no previous file with comments | « Source/bindings/templates/interface_base.cpp ('k') | Source/bindings/tests/results/core/V8TestException.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698