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

Side by Side Diff: Source/bindings/templates/attributes.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
« no previous file with comments | « Source/bindings/scripts/v8_utilities.py ('k') | Source/bindings/templates/methods.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 {##############################################################################} 1 {##############################################################################}
2 {% macro attribute_getter(attribute, world_suffix) %} 2 {% macro attribute_getter(attribute, world_suffix) %}
3 {% filter conditional(attribute.conditional_string) %} 3 {% filter conditional(attribute.conditional_string) %}
4 static void {{attribute.name}}AttributeGetter{{world_suffix}}( 4 static void {{attribute.name}}AttributeGetter{{world_suffix}}(
5 {%- if attribute.is_expose_js_accessors %} 5 {%- if attribute.is_expose_js_accessors %}
6 const v8::FunctionCallbackInfo<v8::Value>& info 6 const v8::FunctionCallbackInfo<v8::Value>& info
7 {%- else %} 7 {%- else %}
8 const v8::PropertyCallbackInfo<v8::Value>& info 8 const v8::PropertyCallbackInfo<v8::Value>& info
9 {%- endif %}) 9 {%- endif %})
10 { 10 {
(...skipping 27 matching lines...) Expand all
38 {% endif %} 38 {% endif %}
39 {% if interface_name == 'Window' and attribute.idl_type == 'EventHandler' %} 39 {% if interface_name == 'Window' and attribute.idl_type == 'EventHandler' %}
40 if (!impl->document()) 40 if (!impl->document())
41 return; 41 return;
42 {% endif %} 42 {% endif %}
43 {# Local variables #} 43 {# Local variables #}
44 {% if attribute.is_call_with_execution_context %} 44 {% if attribute.is_call_with_execution_context %}
45 ExecutionContext* scriptContext = currentExecutionContext(info.GetIsolate()) ; 45 ExecutionContext* scriptContext = currentExecutionContext(info.GetIsolate()) ;
46 {% endif %} 46 {% endif %}
47 {% if attribute.is_call_with_script_state %} 47 {% if attribute.is_call_with_script_state %}
48 ScriptState* state = ScriptState::current(info.GetIsolate()); 48 ScriptState* scriptState = ScriptState::current(info.GetIsolate());
49 {% endif %} 49 {% endif %}
50 {% if attribute.is_check_security_for_node or 50 {% if attribute.is_check_security_for_node or
51 attribute.is_getter_raises_exception %} 51 attribute.is_getter_raises_exception %}
52 ExceptionState exceptionState(ExceptionState::GetterContext, "{{attribute.na me}}", "{{interface_name}}", holder, info.GetIsolate()); 52 ExceptionState exceptionState(ExceptionState::GetterContext, "{{attribute.na me}}", "{{interface_name}}", holder, info.GetIsolate());
53 {% endif %} 53 {% endif %}
54 {% if attribute.is_nullable and not attribute.has_type_checking_nullable %} 54 {% if attribute.is_nullable and not attribute.has_type_checking_nullable %}
55 bool isNull = false; 55 bool isNull = false;
56 {% endif %} 56 {% endif %}
57 {# FIXME: consider always using a local variable for value #} 57 {# FIXME: consider always using a local variable for value #}
58 {% if attribute.cached_attribute_validation_method or 58 {% if attribute.cached_attribute_validation_method or
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 {% endif %} 334 {% endif %}
335 {% if attribute.has_custom_setter %} 335 {% if attribute.has_custom_setter %}
336 {{v8_class}}::{{attribute.name}}AttributeSetterCustom(v8Value, info); 336 {{v8_class}}::{{attribute.name}}AttributeSetterCustom(v8Value, info);
337 {% else %} 337 {% else %}
338 {{cpp_class}}V8Internal::{{attribute.name}}AttributeSetter{{world_suffix}}(v 8Value, info); 338 {{cpp_class}}V8Internal::{{attribute.name}}AttributeSetter{{world_suffix}}(v 8Value, info);
339 {% endif %} 339 {% endif %}
340 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 340 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
341 } 341 }
342 {% endfilter %} 342 {% endfilter %}
343 {% endmacro %} 343 {% endmacro %}
OLDNEW
« no previous file with comments | « Source/bindings/scripts/v8_utilities.py ('k') | Source/bindings/templates/methods.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698