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

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

Issue 1035023005: [bindings] Support CallWith=ThisValue for generic interface methods (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Binding patch alone. Created 5 years, 8 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
« no previous file with comments | « Source/bindings/scripts/v8_methods.py ('k') | Source/bindings/tests/idls/core/TestObject.idl » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 {% from 'conversions.cpp' import v8_value_to_local_cpp_value %} 1 {% from 'conversions.cpp' import v8_value_to_local_cpp_value %}
2 2
3 3
4 {##############################################################################} 4 {##############################################################################}
5 {% macro generate_method(method, world_suffix) %} 5 {% macro generate_method(method, world_suffix) %}
6 {% filter conditional(method.conditional_string) %} 6 {% filter conditional(method.conditional_string) %}
7 {% if method.returns_promise and method.has_exception_state %} 7 {% if method.returns_promise and method.has_exception_state %}
8 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}Promis e(const v8::FunctionCallbackInfo<v8::Value>& info, ExceptionState& exceptionStat e) 8 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}Promis e(const v8::FunctionCallbackInfo<v8::Value>& info, ExceptionState& exceptionStat e)
9 {% else %} 9 {% else %}
10 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}(const v8::FunctionCallbackInfo<v8::Value>& info) 10 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}(const v8::FunctionCallbackInfo<v8::Value>& info)
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 {{throw_type_error(method, '"parameter %s (\'%s\') is not an object."' % 211 {{throw_type_error(method, '"parameter %s (\'%s\') is not an object."' %
212 (argument.index + 1, argument.name)) | indent}} 212 (argument.index + 1, argument.name)) | indent}}
213 } 213 }
214 {% endif %} 214 {% endif %}
215 {% endmacro %} 215 {% endmacro %}
216 216
217 217
218 {######################################} 218 {######################################}
219 {% macro cpp_method_call(method, v8_set_return_value, cpp_value) %} 219 {% macro cpp_method_call(method, v8_set_return_value, cpp_value) %}
220 {# Local variables #} 220 {# Local variables #}
221 {% if method.is_call_with_script_state %} 221 {% if method.is_call_with_script_state or method.is_call_with_this_value %}
222 {# [ConstructorCallWith=ScriptState] #} 222 {# [ConstructorCallWith=ScriptState] #}
223 {# [CallWith=ScriptState] #} 223 {# [CallWith=ScriptState] #}
224 ScriptState* scriptState = ScriptState::current(info.GetIsolate()); 224 ScriptState* scriptState = ScriptState::current(info.GetIsolate());
225 {% endif %} 225 {% endif %}
226 {% if method.is_call_with_execution_context %} 226 {% if method.is_call_with_execution_context %}
227 {# [ConstructorCallWith=ExecutionContext] #} 227 {# [ConstructorCallWith=ExecutionContext] #}
228 {# [CallWith=ExecutionContext] #} 228 {# [CallWith=ExecutionContext] #}
229 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate()); 229 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate());
230 {% endif %} 230 {% endif %}
231 {% if method.is_call_with_script_arguments %} 231 {% if method.is_call_with_script_arguments %}
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after
653 if method.overloads else 653 if method.overloads else
654 method.runtime_enabled_function) %} 654 method.runtime_enabled_function) %}
655 prototypeObject->Set(v8AtomicString(isolate, "{{method.name}}"), v8::Functio nTemplate::New(isolate, {{cpp_class_or_partial}}V8Internal::{{method.name}}Metho dCallback, v8Undefined(), defaultSignature, {{method.number_of_required_argument s}})->GetFunction()); 655 prototypeObject->Set(v8AtomicString(isolate, "{{method.name}}"), v8::Functio nTemplate::New(isolate, {{cpp_class_or_partial}}V8Internal::{{method.name}}Metho dCallback, v8Undefined(), defaultSignature, {{method.number_of_required_argument s}})->GetFunction());
656 {% endfilter %}{# runtime_enabled() #} 656 {% endfilter %}{# runtime_enabled() #}
657 {% endfilter %}{# exposed() #} 657 {% endfilter %}{# exposed() #}
658 {% endfilter %}{# per_context_enabled() #} 658 {% endfilter %}{# per_context_enabled() #}
659 {% endfor %} 659 {% endfor %}
660 {% endif %} 660 {% endif %}
661 } 661 }
662 {%- endmacro %} 662 {%- endmacro %}
OLDNEW
« no previous file with comments | « Source/bindings/scripts/v8_methods.py ('k') | Source/bindings/tests/idls/core/TestObject.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698