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

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

Issue 741783003: Bindings: Support [ConstructorCallWith=ScriptState] (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years 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 {##############################################################################} 1 {##############################################################################}
2 {% macro generate_method(method, world_suffix) %} 2 {% macro generate_method(method, world_suffix) %}
3 {% filter conditional(method.conditional_string) %} 3 {% filter conditional(method.conditional_string) %}
4 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}(const v8::FunctionCallbackInfo<v8::Value>& info) 4 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}(const v8::FunctionCallbackInfo<v8::Value>& info)
5 { 5 {
6 {# Local variables #} 6 {# Local variables #}
7 {% if method.has_exception_state %} 7 {% if method.has_exception_state %}
8 ExceptionState exceptionState(ExceptionState::ExecutionContext, "{{method.na me}}", "{{interface_name}}", info.Holder(), info.GetIsolate()); 8 ExceptionState exceptionState(ExceptionState::ExecutionContext, "{{method.na me}}", "{{interface_name}}", info.Holder(), info.GetIsolate());
9 {% endif %} 9 {% endif %}
10 {# Overloaded methods have length checked during overload resolution #} 10 {# Overloaded methods have length checked during overload resolution #}
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 return; 203 return;
204 } 204 }
205 {% endif %} 205 {% endif %}
206 {% endmacro %} 206 {% endmacro %}
207 207
208 208
209 {######################################} 209 {######################################}
210 {% macro cpp_method_call(method, v8_set_return_value, cpp_value) %} 210 {% macro cpp_method_call(method, v8_set_return_value, cpp_value) %}
211 {# Local variables #} 211 {# Local variables #}
212 {% if method.is_call_with_script_state %} 212 {% if method.is_call_with_script_state %}
213 {# [ConstructorCallWith=ScriptState] #}
213 {# [CallWith=ScriptState] #} 214 {# [CallWith=ScriptState] #}
214 ScriptState* scriptState = ScriptState::current(info.GetIsolate()); 215 ScriptState* scriptState = ScriptState::current(info.GetIsolate());
215 {% endif %} 216 {% endif %}
216 {% if method.is_call_with_execution_context %} 217 {% if method.is_call_with_execution_context %}
217 {# [ConstructorCallWith=ExecutionContext] #} 218 {# [ConstructorCallWith=ExecutionContext] #}
218 {# [CallWith=ExecutionContext] #} 219 {# [CallWith=ExecutionContext] #}
219 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate()); 220 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate());
220 {% endif %} 221 {% endif %}
221 {% if method.is_call_with_script_arguments %} 222 {% if method.is_call_with_script_arguments %}
222 {# [CallWith=ScriptArguments] #} 223 {# [CallWith=ScriptArguments] #}
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after
644 {% filter exposed(method.exposed_test) %} 645 {% filter exposed(method.exposed_test) %}
645 {% filter runtime_enabled(method.overloads.runtime_enabled_function_all if m ethod.overloads else method.runtime_enabled_function) %} 646 {% filter runtime_enabled(method.overloads.runtime_enabled_function_all if m ethod.overloads else method.runtime_enabled_function) %}
646 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()); 647 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());
647 {% endfilter %} 648 {% endfilter %}
648 {% endfilter %} 649 {% endfilter %}
649 {% endfilter %} 650 {% endfilter %}
650 {% endfor %} 651 {% endfor %}
651 {% endif %} 652 {% endif %}
652 } 653 }
653 {%- endmacro %} 654 {%- endmacro %}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698