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

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

Issue 297513008: Decrease call sites of ScriptState::current() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 7 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 | 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 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 return; 222 return;
223 } 223 }
224 {% endif %} 224 {% endif %}
225 {% endmacro %} 225 {% endmacro %}
226 226
227 227
228 {######################################} 228 {######################################}
229 {% macro cpp_method_call(method, v8_set_return_value, cpp_value) %} 229 {% macro cpp_method_call(method, v8_set_return_value, cpp_value) %}
230 {# Local variables #} 230 {# Local variables #}
231 {% if method.is_call_with_script_state %} 231 {% if method.is_call_with_script_state %}
232 ScriptState* state = ScriptState::current(info.GetIsolate()); 232 ScriptState* scriptState = ScriptState::current(info.GetIsolate());
233 {% endif %} 233 {% endif %}
234 {% if method.is_call_with_execution_context %} 234 {% if method.is_call_with_execution_context %}
235 ExecutionContext* scriptContext = currentExecutionContext(info.GetIsolate()); 235 ExecutionContext* scriptContext = currentExecutionContext(info.GetIsolate());
236 {% endif %} 236 {% endif %}
237 {% if method.is_call_with_script_arguments %} 237 {% if method.is_call_with_script_arguments %}
238 RefPtr<ScriptArguments> scriptArguments(createScriptArguments(info, {{method.num ber_of_arguments}})); 238 RefPtr<ScriptArguments> scriptArguments(createScriptArguments(info, {{method.num ber_of_arguments}}));
239 {% endif %} 239 {% endif %}
240 {# Call #} 240 {# Call #}
241 {% if method.idl_type == 'void' %} 241 {% if method.idl_type == 'void' %}
242 {{cpp_value}}; 242 {{cpp_value}};
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
544 {% endif %} 544 {% endif %}
545 {{constructor.cpp_type}} impl = {{cpp_class}}::createForJSConstructor({{cons tructor.argument_list | join(', ')}}); 545 {{constructor.cpp_type}} impl = {{cpp_class}}::createForJSConstructor({{cons tructor.argument_list | join(', ')}});
546 {% if is_constructor_raises_exception %} 546 {% if is_constructor_raises_exception %}
547 if (exceptionState.throwIfNeeded()) 547 if (exceptionState.throwIfNeeded())
548 return; 548 return;
549 {% endif %} 549 {% endif %}
550 550
551 {{generate_constructor_wrapper(constructor) | indent}} 551 {{generate_constructor_wrapper(constructor) | indent}}
552 } 552 }
553 {% endmacro %} 553 {% endmacro %}
OLDNEW
« no previous file with comments | « Source/bindings/templates/attributes.cpp ('k') | Source/bindings/tests/results/V8TestInterfaceWillBeGarbageCollected.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698