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

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

Issue 1226203012: Revert of bindings: Makes almost all attributes accessor-type properties. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 5 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/interface.h » ('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 declare_enum_validation_variable, v8_value_to_l ocal_cpp_value %} 1 {% from 'conversions.cpp' import declare_enum_validation_variable, v8_value_to_l ocal_cpp_value %}
2 2
3 3
4 {##############################################################################} 4 {##############################################################################}
5 {% macro attribute_getter(attribute, world_suffix) %} 5 {% macro attribute_getter(attribute, world_suffix) %}
6 {% filter conditional(attribute.conditional_string) %} 6 {% filter conditional(attribute.conditional_string) %}
7 static void {{attribute.name}}AttributeGetter{{world_suffix}}( 7 static void {{attribute.name}}AttributeGetter{{world_suffix}}(
8 {%- if attribute.is_data_type_property %} 8 {%- if attribute.is_expose_js_accessors %}
9 const v8::FunctionCallbackInfo<v8::Value>& info
10 {%- else %}
9 const v8::PropertyCallbackInfo<v8::Value>& info 11 const v8::PropertyCallbackInfo<v8::Value>& info
10 {%- else %}
11 const v8::FunctionCallbackInfo<v8::Value>& info
12 {%- endif %}) 12 {%- endif %})
13 { 13 {
14 {% if attribute.is_reflect and not attribute.is_url 14 {% if attribute.is_reflect and not attribute.is_url
15 and attribute.idl_type == 'DOMString' and is_node 15 and attribute.idl_type == 'DOMString' and is_node
16 and not attribute.is_implemented_in_private_script %} 16 and not attribute.is_implemented_in_private_script %}
17 {% set cpp_class, v8_class = 'Element', 'V8Element' %} 17 {% set cpp_class, v8_class = 'Element', 'V8Element' %}
18 {% endif %} 18 {% endif %}
19 {# holder #} 19 {# holder #}
20 {% if not attribute.is_static %} 20 {% if not attribute.is_static %}
21 {% if attribute.is_lenient_this %} 21 {% if attribute.is_lenient_this %}
(...skipping 26 matching lines...) Expand all
48 {% endif %} 48 {% endif %}
49 {# Local variables #} 49 {# Local variables #}
50 {% if attribute.is_call_with_execution_context %} 50 {% if attribute.is_call_with_execution_context %}
51 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate ()); 51 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate ());
52 {% endif %} 52 {% endif %}
53 {% if attribute.is_call_with_script_state %} 53 {% if attribute.is_call_with_script_state %}
54 ScriptState* scriptState = ScriptState::current(info.GetIsolate()); 54 ScriptState* scriptState = ScriptState::current(info.GetIsolate());
55 {% endif %} 55 {% endif %}
56 {% if ((attribute.is_check_security_for_frame or 56 {% if ((attribute.is_check_security_for_frame or
57 attribute.is_check_security_for_window) and 57 attribute.is_check_security_for_window) and
58 not attribute.is_data_type_property) or 58 attribute.is_expose_js_accessors) or
59 attribute.is_check_security_for_node or 59 attribute.is_check_security_for_node or
60 attribute.is_getter_raises_exception %} 60 attribute.is_getter_raises_exception %}
61 ExceptionState exceptionState(ExceptionState::GetterContext, "{{attribute.na me}}", "{{interface_name}}", holder, info.GetIsolate()); 61 ExceptionState exceptionState(ExceptionState::GetterContext, "{{attribute.na me}}", "{{interface_name}}", holder, info.GetIsolate());
62 {% endif %} 62 {% endif %}
63 {% if attribute.is_explicit_nullable %} 63 {% if attribute.is_explicit_nullable %}
64 bool isNull = false; 64 bool isNull = false;
65 {% endif %} 65 {% endif %}
66 {% if attribute.is_implemented_in_private_script %} 66 {% if attribute.is_implemented_in_private_script %}
67 {{attribute.cpp_type}} result{{attribute.cpp_type_initializer}}; 67 {{attribute.cpp_type}} result{{attribute.cpp_type_initializer}};
68 if (!{{attribute.cpp_value_original}}) 68 if (!{{attribute.cpp_value_original}})
69 return; 69 return;
70 {% elif attribute.cpp_value_original %} 70 {% elif attribute.cpp_value_original %}
71 {{attribute.cpp_type}} {{attribute.cpp_value}}({{attribute.cpp_value_origina l}}); 71 {{attribute.cpp_type}} {{attribute.cpp_value}}({{attribute.cpp_value_origina l}});
72 {% endif %} 72 {% endif %}
73 {# Checks #} 73 {# Checks #}
74 {% if attribute.is_getter_raises_exception %} 74 {% if attribute.is_getter_raises_exception %}
75 if (UNLIKELY(exceptionState.throwIfNeeded())) 75 if (UNLIKELY(exceptionState.throwIfNeeded()))
76 return; 76 return;
77 {% endif %} 77 {% endif %}
78 {# Security checks #} 78 {# Security checks #}
79 {% if not attribute.is_data_type_property %} 79 {% if attribute.is_expose_js_accessors %}
80 {% if attribute.is_check_security_for_window %} 80 {% if attribute.is_check_security_for_window %}
81 if (LocalDOMWindow* window = impl->toDOMWindow()) { 81 if (LocalDOMWindow* window = impl->toDOMWindow()) {
82 if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), window ->frame(), exceptionState)) { 82 if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), window ->frame(), exceptionState)) {
83 v8SetReturnValueNull(info); 83 v8SetReturnValueNull(info);
84 exceptionState.throwIfNeeded(); 84 exceptionState.throwIfNeeded();
85 return; 85 return;
86 } 86 }
87 if (!window->document()) 87 if (!window->document())
88 return; 88 return;
89 } 89 }
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 {% if attribute.use_output_parameter_for_result %} 133 {% if attribute.use_output_parameter_for_result %}
134 {{attribute.cpp_type}} result; 134 {{attribute.cpp_type}} result;
135 {{attribute.cpp_value}}; 135 {{attribute.cpp_value}};
136 {% endif %} 136 {% endif %}
137 {{attribute.v8_set_return_value}}; 137 {{attribute.v8_set_return_value}};
138 {% endif %} 138 {% endif %}
139 } 139 }
140 {% endfilter %} 140 {% endfilter %}
141 {% endmacro %} 141 {% endmacro %}
142 142
143
144 {######################################} 143 {######################################}
145 {% macro release_only_check(reflect_only_values, reflect_missing, 144 {% macro release_only_check(reflect_only_values, reflect_missing,
146 reflect_invalid, reflect_empty, cpp_value) %} 145 reflect_invalid, reflect_empty, cpp_value) %}
147 {# Attribute is limited to only known values: check that the attribute value is 146 {# Attribute is limited to only known values: check that the attribute value is
148 one of those. If not, set it to the empty string. 147 one of those. If not, set it to the empty string.
149 http://www.whatwg.org/specs/web-apps/current-work/#limited-to-only-known-valu es #} 148 http://www.whatwg.org/specs/web-apps/current-work/#limited-to-only-known-valu es #}
150 {% if reflect_empty %} 149 {% if reflect_empty %}
151 if ({{cpp_value}}.isNull()) { 150 if ({{cpp_value}}.isNull()) {
152 {% if reflect_missing %} 151 {% if reflect_missing %}
153 {{cpp_value}} = "{{reflect_missing}}"; 152 {{cpp_value}} = "{{reflect_missing}}";
(...skipping 18 matching lines...) Expand all
172 } else { 171 } else {
173 {{cpp_value}} = "{{reflect_invalid}}"; 172 {{cpp_value}} = "{{reflect_invalid}}";
174 } 173 }
175 {% endmacro %} 174 {% endmacro %}
176 175
177 176
178 {##############################################################################} 177 {##############################################################################}
179 {% macro attribute_getter_callback(attribute, world_suffix) %} 178 {% macro attribute_getter_callback(attribute, world_suffix) %}
180 {% filter conditional(attribute.conditional_string) %} 179 {% filter conditional(attribute.conditional_string) %}
181 static void {{attribute.name}}AttributeGetterCallback{{world_suffix}}( 180 static void {{attribute.name}}AttributeGetterCallback{{world_suffix}}(
182 {%- if attribute.is_data_type_property %} 181 {%- if attribute.is_expose_js_accessors %}
182 const v8::FunctionCallbackInfo<v8::Value>& info
183 {%- else %}
183 v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value>& info 184 v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value>& info
184 {%- else %}
185 const v8::FunctionCallbackInfo<v8::Value>& info
186 {%- endif %}) 185 {%- endif %})
187 { 186 {
188 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 187 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
189 {% if attribute.deprecate_as %} 188 {% if attribute.deprecate_as %}
190 UseCounter::countDeprecationIfNotPrivateScript(info.GetIsolate(), callingExe cutionContext(info.GetIsolate()), UseCounter::{{attribute.deprecate_as}}); 189 UseCounter::countDeprecationIfNotPrivateScript(info.GetIsolate(), callingExe cutionContext(info.GetIsolate()), UseCounter::{{attribute.deprecate_as}});
191 {% endif %} 190 {% endif %}
192 {% if attribute.measure_as %} 191 {% if attribute.measure_as %}
193 UseCounter::countIfNotPrivateScript(info.GetIsolate(), callingExecutionConte xt(info.GetIsolate()), UseCounter::{{attribute.measure_as('AttributeGetter')}}); 192 UseCounter::countIfNotPrivateScript(info.GetIsolate(), callingExecutionConte xt(info.GetIsolate()), UseCounter::{{attribute.measure_as('AttributeGetter')}});
194 {% endif %} 193 {% endif %}
195 {% if world_suffix in attribute.activity_logging_world_list_for_getter %} 194 {% if world_suffix in attribute.activity_logging_world_list_for_getter %}
(...skipping 13 matching lines...) Expand all
209 {% endif %} 208 {% endif %}
210 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 209 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
211 } 210 }
212 {% endfilter %} 211 {% endfilter %}
213 {% endmacro %} 212 {% endmacro %}
214 213
215 214
216 {##############################################################################} 215 {##############################################################################}
217 {% macro constructor_getter_callback(attribute, world_suffix) %} 216 {% macro constructor_getter_callback(attribute, world_suffix) %}
218 {% filter conditional(attribute.conditional_string) %} 217 {% filter conditional(attribute.conditional_string) %}
219 static void {{attribute.name}}ConstructorGetterCallback{{world_suffix}}(v8::Loca l<v8::Name> property, const v8::PropertyCallbackInfo<v8::Value>& info) 218 static void {{attribute.name}}ConstructorGetterCallback{{world_suffix}}(
219 {%- if attribute.is_expose_js_accessors %}
220 const v8::FunctionCallbackInfo<v8::Value>& info
221 {%- else %}
222 v8::Local<v8::Name> property, const v8::PropertyCallbackInfo<v8::Value>& info
223 {%- endif %})
220 { 224 {
221 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 225 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
222 {% if attribute.deprecate_as %} 226 {% if attribute.deprecate_as %}
223 UseCounter::countDeprecationIfNotPrivateScript(info.GetIsolate(), callingExe cutionContext(info.GetIsolate()), UseCounter::{{attribute.deprecate_as}}); 227 UseCounter::countDeprecationIfNotPrivateScript(info.GetIsolate(), callingExe cutionContext(info.GetIsolate()), UseCounter::{{attribute.deprecate_as}});
224 {% endif %} 228 {% endif %}
225 {% if attribute.measure_as %} 229 {% if attribute.measure_as %}
226 UseCounter::countIfNotPrivateScript(info.GetIsolate(), callingExecutionConte xt(info.GetIsolate()), UseCounter::{{attribute.measure_as('ConstructorGetter')}} ); 230 UseCounter::countIfNotPrivateScript(info.GetIsolate(), callingExecutionConte xt(info.GetIsolate()), UseCounter::{{attribute.measure_as('ConstructorGetter')}} );
227 {% endif %} 231 {% endif %}
228 v8ConstructorAttributeGetter(property, info); 232 v8ConstructorAttributeGetter(property, info);
229 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 233 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
230 } 234 }
231 {% endfilter %} 235 {% endfilter %}
232 {% endmacro %} 236 {% endmacro %}
233 237
234 238
235 {##############################################################################} 239 {##############################################################################}
236 {% macro attribute_setter(attribute, world_suffix) %} 240 {% macro attribute_setter(attribute, world_suffix) %}
237 {% filter conditional(attribute.conditional_string) %} 241 {% filter conditional(attribute.conditional_string) %}
238 static void {{attribute.name}}AttributeSetter{{world_suffix}}( 242 static void {{attribute.name}}AttributeSetter{{world_suffix}}(
239 {%- if attribute.is_data_type_property %} 243 {%- if attribute.is_expose_js_accessors %}
244 v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info
245 {%- else %}
240 v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info 246 v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info
241 {%- else %}
242 v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info
243 {%- endif %}) 247 {%- endif %})
244 { 248 {
245 {% if attribute.is_reflect and attribute.idl_type == 'DOMString' 249 {% if attribute.is_reflect and attribute.idl_type == 'DOMString'
246 and is_node and not attribute.is_implemented_in_private_script %} 250 and is_node and not attribute.is_implemented_in_private_script %}
247 {% set cpp_class, v8_class = 'Element', 'V8Element' %} 251 {% set cpp_class, v8_class = 'Element', 'V8Element' %}
248 {% endif %} 252 {% endif %}
249 {% if attribute.has_setter_exception_state or 253 {% if attribute.has_setter_exception_state or
250 ((not attribute.is_replaceable and 254 ((not attribute.is_replaceable and
251 not attribute.constructor_type and 255 not attribute.constructor_type and
252 not attribute.is_data_type_property) and 256 attribute.is_expose_js_accessors) and
253 (attribute.is_check_security_for_frame or 257 (attribute.is_check_security_for_frame or
254 attribute.is_check_security_for_node or 258 attribute.is_check_security_for_node or
255 attribute.is_check_security_for_window)) %} 259 attribute.is_check_security_for_window)) %}
256 {% set raise_exception = 1 %} 260 {% set raise_exception = 1 %}
257 {% else %} 261 {% else %}
258 {% set raise_exception = 0 %} 262 {% set raise_exception = 0 %}
259 {% endif %} 263 {% endif %}
260 {# Local variables #} 264 {# Local variables #}
261 {% if (not attribute.is_static and 265 {% if (not attribute.is_static and
262 not attribute.is_replaceable and 266 not attribute.is_replaceable and
(...skipping 27 matching lines...) Expand all
290 not attribute.constructor_type %} 294 not attribute.constructor_type %}
291 {{cpp_class}}* impl = {{v8_class}}::toImpl(holder); 295 {{cpp_class}}* impl = {{v8_class}}::toImpl(holder);
292 {% endif %} 296 {% endif %}
293 {% if attribute.idl_type == 'EventHandler' and interface_name == 'Window' %} 297 {% if attribute.idl_type == 'EventHandler' and interface_name == 'Window' %}
294 if (!impl->document()) 298 if (!impl->document())
295 return; 299 return;
296 {% endif %} 300 {% endif %}
297 {# Security checks #} 301 {# Security checks #}
298 {% if not attribute.is_replaceable and 302 {% if not attribute.is_replaceable and
299 not attribute.constructor_type %} 303 not attribute.constructor_type %}
300 {% if not attribute.is_data_type_property %} 304 {% if attribute.is_expose_js_accessors %}
301 {% if attribute.is_check_security_for_window %} 305 {% if attribute.is_check_security_for_window %}
302 if (LocalDOMWindow* window = impl->toDOMWindow()) { 306 if (LocalDOMWindow* window = impl->toDOMWindow()) {
303 if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), window ->frame(), exceptionState)) { 307 if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), window ->frame(), exceptionState)) {
304 v8SetReturnValue(info, v8Value); 308 v8SetReturnValue(info, v8Value);
305 exceptionState.throwIfNeeded(); 309 exceptionState.throwIfNeeded();
306 return; 310 return;
307 } 311 }
308 if (!window->document()) 312 if (!window->document())
309 return; 313 return;
310 } 314 }
311 {% elif attribute.is_check_security_for_frame %} 315 {% elif attribute.is_check_security_for_frame %}
312 if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), impl->fram e(), exceptionState)) { 316 if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), impl->fram e(), exceptionState)) {
313 v8SetReturnValue(info, v8Value); 317 v8SetReturnValue(info, v8Value);
314 exceptionState.throwIfNeeded(); 318 exceptionState.throwIfNeeded();
315 return; 319 return;
316 } 320 }
317 {% endif %} 321 {% endif %}
318 {% endif %} 322 {% endif %}
319 {% if attribute.is_check_security_for_node %} 323 {% if attribute.is_check_security_for_node %}
320 if (!BindingSecurity::shouldAllowAccessToNode(info.GetIsolate(), {{attribute .cpp_value}}, exceptionState)) { 324 if (!BindingSecurity::shouldAllowAccessToNode(info.GetIsolate(), {{attribute .cpp_value}}, exceptionState)) {
321 v8SetReturnValue(info, v8Value); 325 v8SetReturnValue(info, v8Value);
322 exceptionState.throwIfNeeded(); 326 exceptionState.throwIfNeeded();
323 return; 327 return;
324 } 328 }
325 {% endif %} 329 {% endif %}
326 {% endif %}{# not attribute.is_replaceable and 330 {% endif %}{# not attribute.is_replaceable #}
327 not attribute.constructor_type #}
328 {# Convert JS value to C++ value #} 331 {# Convert JS value to C++ value #}
329 {% if attribute.idl_type != 'EventHandler' %} 332 {% if attribute.idl_type != 'EventHandler' %}
330 {% if v8_value_to_local_cpp_value(attribute) %} 333 {% if v8_value_to_local_cpp_value(attribute) %}
331 {{v8_value_to_local_cpp_value(attribute) | indent}} 334 {{v8_value_to_local_cpp_value(attribute) | indent}}
332 {% endif %} 335 {% endif %}
333 {% elif not is_node %}{# EventHandler hack #} 336 {% elif not is_node %}{# EventHandler hack #}
334 moveEventListenerToNewWrapper(info.GetIsolate(), holder, {{attribute.event_h andler_getter_expression}}, v8Value, {{v8_class}}::eventListenerCacheIndex); 337 moveEventListenerToNewWrapper(info.GetIsolate(), holder, {{attribute.event_h andler_getter_expression}}, v8Value, {{v8_class}}::eventListenerCacheIndex);
335 {% endif %} 338 {% endif %}
336 {# Type checking, possibly throw a TypeError, per: 339 {# Type checking, possibly throw a TypeError, per:
337 http://www.w3.org/TR/WebIDL/#es-type-mapping #} 340 http://www.w3.org/TR/WebIDL/#es-type-mapping #}
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 {% endif %} 385 {% endif %}
383 } 386 }
384 {% endfilter %} 387 {% endfilter %}
385 {% endmacro %} 388 {% endmacro %}
386 389
387 390
388 {##############################################################################} 391 {##############################################################################}
389 {% macro attribute_setter_callback(attribute, world_suffix) %} 392 {% macro attribute_setter_callback(attribute, world_suffix) %}
390 {% filter conditional(attribute.conditional_string) %} 393 {% filter conditional(attribute.conditional_string) %}
391 static void {{attribute.name}}AttributeSetterCallback{{world_suffix}}( 394 static void {{attribute.name}}AttributeSetterCallback{{world_suffix}}(
392 {%- if attribute.is_data_type_property %} 395 {%- if attribute.is_expose_js_accessors %}
396 const v8::FunctionCallbackInfo<v8::Value>& info
397 {%- else %}
393 v8::Local<v8::Name>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInf o<void>& info 398 v8::Local<v8::Name>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInf o<void>& info
394 {%- else %}
395 const v8::FunctionCallbackInfo<v8::Value>& info
396 {%- endif %}) 399 {%- endif %})
397 { 400 {
398 {% if not attribute.is_data_type_property %} 401 {% if attribute.is_expose_js_accessors %}
399 v8::Local<v8::Value> v8Value = info[0]; 402 v8::Local<v8::Value> v8Value = info[0];
400 {% endif %} 403 {% endif %}
401 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 404 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter");
402 {% if attribute.deprecate_as %} 405 {% if attribute.deprecate_as %}
403 UseCounter::countDeprecationIfNotPrivateScript(info.GetIsolate(), callingExe cutionContext(info.GetIsolate()), UseCounter::{{attribute.deprecate_as}}); 406 UseCounter::countDeprecationIfNotPrivateScript(info.GetIsolate(), callingExe cutionContext(info.GetIsolate()), UseCounter::{{attribute.deprecate_as}});
404 {% endif %} 407 {% endif %}
405 {% if attribute.measure_as %} 408 {% if attribute.measure_as %}
406 UseCounter::countIfNotPrivateScript(info.GetIsolate(), callingExecutionConte xt(info.GetIsolate()), UseCounter::{{attribute.measure_as('AttributeSetter')}}); 409 UseCounter::countIfNotPrivateScript(info.GetIsolate(), callingExecutionConte xt(info.GetIsolate()), UseCounter::{{attribute.measure_as('AttributeSetter')}});
407 {% endif %} 410 {% endif %}
408 {% if world_suffix in attribute.activity_logging_world_list_for_setter %} 411 {% if world_suffix in attribute.activity_logging_world_list_for_setter %}
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
508 {% set getter_callback_for_main_world = 511 {% set getter_callback_for_main_world =
509 '%sForMainWorld' % getter_callback 512 '%sForMainWorld' % getter_callback
510 if attribute.is_per_world_bindings else '0' %} 513 if attribute.is_per_world_bindings else '0' %}
511 {% set setter_callback_for_main_world = 514 {% set setter_callback_for_main_world =
512 '%sForMainWorld' % setter_callback 515 '%sForMainWorld' % setter_callback
513 if attribute.is_per_world_bindings and attribute.has_setter else '0' %} 516 if attribute.is_per_world_bindings and attribute.has_setter else '0' %}
514 {% set wrapper_type_info = 517 {% set wrapper_type_info =
515 'const_cast<WrapperTypeInfo*>(&V8%s::wrapperTypeInfo)' % 518 'const_cast<WrapperTypeInfo*>(&V8%s::wrapperTypeInfo)' %
516 attribute.constructor_type 519 attribute.constructor_type
517 if attribute.constructor_type else '0' %} 520 if attribute.constructor_type else '0' %}
518 {% if attribute.is_data_type_property %}
519 {% set access_control = 'static_cast<v8::AccessControl>(%s)' % 521 {% set access_control = 'static_cast<v8::AccessControl>(%s)' %
520 ' | '.join(attribute.access_control_list) %} 522 ' | '.join(attribute.access_control_list) %}
521 {% else %}
522 {% set access_control = 'v8::DEFAULT' %}
523 {% endif %}
524 {% set property_attribute = 'static_cast<v8::PropertyAttribute>(%s)' % 523 {% set property_attribute = 'static_cast<v8::PropertyAttribute>(%s)' %
525 ' | '.join(attribute.property_attributes) %} 524 ' | '.join(attribute.property_attributes) %}
526 {% set only_exposed_to_private_script = 525 {% set only_exposed_to_private_script =
527 'V8DOMConfiguration::OnlyExposedToPrivateScript' 526 'V8DOMConfiguration::OnlyExposedToPrivateScript'
528 if attribute.only_exposed_to_private_script else 527 if attribute.only_exposed_to_private_script else
529 'V8DOMConfiguration::ExposedToAllScripts' %} 528 'V8DOMConfiguration::ExposedToAllScripts' %}
530 {% set property_location_list = [] %} 529 {% set property_location_list = [] %}
531 {% if attribute.on_instance %} 530 {% if attribute.on_instance %}
532 {% set property_location_list = property_location_list + ['V8DOMConfiguration::O nInstance'] %} 531 {% set property_location_list = property_location_list + ['V8DOMConfiguration::O nInstance'] %}
533 {% endif %} 532 {% endif %}
(...skipping 14 matching lines...) Expand all
548 setter_callback_for_main_world, 547 setter_callback_for_main_world,
549 wrapper_type_info, 548 wrapper_type_info,
550 access_control, 549 access_control,
551 property_attribute, 550 property_attribute,
552 only_exposed_to_private_script, 551 only_exposed_to_private_script,
553 property_location, 552 property_location,
554 holder_check, 553 holder_check,
555 ] %} 554 ] %}
556 {{'{'}}{{attribute_configuration_list | join(', ')}}{{'}'}} 555 {{'{'}}{{attribute_configuration_list | join(', ')}}{{'}'}}
557 {%- endmacro %} 556 {%- endmacro %}
OLDNEW
« no previous file with comments | « Source/bindings/scripts/v8_utilities.py ('k') | Source/bindings/templates/interface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698