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

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

Issue 334283004: Rename DOMWindow to LocalDOMWindow (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 years, 6 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_types.py ('k') | Source/bindings/tests/results/V8TestInterface2.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 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 #}
11 {% if method.number_of_required_arguments and not method.overload_index %} 11 {% if method.number_of_required_arguments and not method.overload_index %}
12 if (UNLIKELY(info.Length() < {{method.number_of_required_arguments}})) { 12 if (UNLIKELY(info.Length() < {{method.number_of_required_arguments}})) {
13 {{throw_minimum_arity_type_error(method, method.number_of_required_argum ents)}}; 13 {{throw_minimum_arity_type_error(method, method.number_of_required_argum ents)}};
14 return; 14 return;
15 } 15 }
16 {% endif %} 16 {% endif %}
17 {% if not method.is_static %} 17 {% if not method.is_static %}
18 {{cpp_class}}* impl = {{v8_class}}::toNative(info.Holder()); 18 {{cpp_class}}* impl = {{v8_class}}::toNative(info.Holder());
19 {% endif %} 19 {% endif %}
20 {% if method.is_custom_element_callbacks %} 20 {% if method.is_custom_element_callbacks %}
21 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; 21 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
22 {% endif %} 22 {% endif %}
23 {# Security checks #} 23 {# Security checks #}
24 {# FIXME: change to method.is_check_security_for_window #} 24 {# FIXME: change to method.is_check_security_for_window #}
25 {% if interface_name == 'EventTarget' %} 25 {% if interface_name == 'EventTarget' %}
26 if (DOMWindow* window = impl->toDOMWindow()) { 26 if (LocalDOMWindow* window = impl->toDOMWindow()) {
27 if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), window ->frame(), exceptionState)) { 27 if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), window ->frame(), exceptionState)) {
28 {{throw_from_exception_state(method)}}; 28 {{throw_from_exception_state(method)}};
29 return; 29 return;
30 } 30 }
31 if (!window->document()) 31 if (!window->document())
32 return; 32 return;
33 } 33 }
34 {% elif method.is_check_security_for_frame %} 34 {% elif method.is_check_security_for_frame %}
35 if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), impl->fram e(), exceptionState)) { 35 if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), impl->fram e(), exceptionState)) {
36 {{throw_from_exception_state(method)}}; 36 {{throw_from_exception_state(method)}};
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after
562 {% endif %} 562 {% endif %}
563 {{constructor.cpp_type}} impl = {{constructor.cpp_value}}; 563 {{constructor.cpp_type}} impl = {{constructor.cpp_value}};
564 {% if is_constructor_raises_exception %} 564 {% if is_constructor_raises_exception %}
565 if (exceptionState.throwIfNeeded()) 565 if (exceptionState.throwIfNeeded())
566 return; 566 return;
567 {% endif %} 567 {% endif %}
568 568
569 {{generate_constructor_wrapper(constructor) | indent}} 569 {{generate_constructor_wrapper(constructor) | indent}}
570 } 570 }
571 {% endmacro %} 571 {% endmacro %}
OLDNEW
« no previous file with comments | « Source/bindings/scripts/v8_types.py ('k') | Source/bindings/tests/results/V8TestInterface2.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698