OLD | NEW |
1 {% include 'copyright_block.txt' %} | 1 {% include 'copyright_block.txt' %} |
2 #include "config.h" | 2 #include "config.h" |
3 {% filter conditional(conditional_string) %} | 3 {% filter conditional(conditional_string) %} |
4 #include "{{v8_class_or_partial}}.h" | 4 #include "{{v8_class_or_partial}}.h" |
5 | 5 |
6 {% for filename in cpp_includes if filename != '%s.h' % cpp_class_or_partial %} | 6 {% for filename in cpp_includes if filename != '%s.h' % cpp_class_or_partial %} |
7 #include "{{filename}}" | 7 #include "{{filename}}" |
8 {% endfor %} | 8 {% endfor %} |
9 | 9 |
10 namespace blink { | 10 namespace blink { |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 {##############################################################################} | 218 {##############################################################################} |
219 {% block install_attributes %} | 219 {% block install_attributes %} |
220 {% from 'attributes.cpp' import attribute_configuration with context %} | 220 {% from 'attributes.cpp' import attribute_configuration with context %} |
221 {% if has_attribute_configuration %} | 221 {% if has_attribute_configuration %} |
222 // Suppress warning: global constructors, because AttributeConfiguration is triv
ial | 222 // Suppress warning: global constructors, because AttributeConfiguration is triv
ial |
223 // and does not depend on another global objects. | 223 // and does not depend on another global objects. |
224 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) | 224 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) |
225 #pragma clang diagnostic push | 225 #pragma clang diagnostic push |
226 #pragma clang diagnostic ignored "-Wglobal-constructors" | 226 #pragma clang diagnostic ignored "-Wglobal-constructors" |
227 #endif | 227 #endif |
228 static const V8DOMConfiguration::AttributeConfiguration {{v8_class}}Attributes[]
= { | 228 const V8DOMConfiguration::AttributeConfiguration {{v8_class}}Attributes[] = { |
229 {% for attribute in attributes | 229 {% for attribute in attributes |
230 if not (attribute.exposed_test or | 230 if not (attribute.exposed_test or |
231 attribute.runtime_enabled_function) and | 231 attribute.runtime_enabled_function) and |
232 attribute.is_data_type_property and | 232 attribute.is_data_type_property and |
233 attribute.should_be_exposed_to_script %} | 233 attribute.should_be_exposed_to_script %} |
234 {% filter conditional(attribute.conditional_string) %} | 234 {% filter conditional(attribute.conditional_string) %} |
235 {{attribute_configuration(attribute)}}, | 235 {{attribute_configuration(attribute)}}, |
236 {% endfilter %} | 236 {% endfilter %} |
237 {% endfor %} | 237 {% endfor %} |
238 }; | 238 }; |
239 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) | 239 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) |
240 #pragma clang diagnostic pop | 240 #pragma clang diagnostic pop |
241 #endif | 241 #endif |
242 | 242 |
243 {% endif %} | 243 {% endif %} |
244 {% endblock %} | 244 {% endblock %} |
245 {##############################################################################} | 245 {##############################################################################} |
246 {% block install_accessors %} | 246 {% block install_accessors %} |
247 {% from 'attributes.cpp' import attribute_configuration with context %} | 247 {% from 'attributes.cpp' import attribute_configuration with context %} |
248 {% if has_accessor_configuration %} | 248 {% if has_accessor_configuration %} |
249 static const V8DOMConfiguration::AccessorConfiguration {{v8_class}}Accessors[] =
{ | 249 const V8DOMConfiguration::AccessorConfiguration {{v8_class}}Accessors[] = { |
250 {% for attribute in attributes | 250 {% for attribute in attributes |
251 if not (attribute.exposed_test or | 251 if not (attribute.exposed_test or |
252 attribute.runtime_enabled_function) and | 252 attribute.runtime_enabled_function) and |
253 not attribute.is_data_type_property and | 253 not attribute.is_data_type_property and |
254 attribute.should_be_exposed_to_script %} | 254 attribute.should_be_exposed_to_script %} |
255 {% filter conditional(attribute.conditional_string) %} | 255 {% filter conditional(attribute.conditional_string) %} |
256 {{attribute_configuration(attribute)}}, | 256 {{attribute_configuration(attribute)}}, |
257 {% endfilter %} | 257 {% endfilter %} |
258 {% endfor %} | 258 {% endfor %} |
259 }; | 259 }; |
260 | 260 |
261 {% endif %} | 261 {% endif %} |
262 {% endblock %} | 262 {% endblock %} |
263 {##############################################################################} | 263 {##############################################################################} |
264 {% block install_methods %} | 264 {% block install_methods %} |
265 {% from 'methods.cpp' import method_configuration with context %} | 265 {% from 'methods.cpp' import method_configuration with context %} |
266 {% if method_configuration_methods %} | 266 {% if method_configuration_methods %} |
267 static const V8DOMConfiguration::MethodConfiguration {{v8_class}}Methods[] = { | 267 const V8DOMConfiguration::MethodConfiguration {{v8_class}}Methods[] = { |
268 {% for method in method_configuration_methods %} | 268 {% for method in method_configuration_methods %} |
269 {% filter conditional(method.conditional_string) %} | 269 {% filter conditional(method.conditional_string) %} |
270 {{method_configuration(method)}}, | 270 {{method_configuration(method)}}, |
271 {% endfilter %} | 271 {% endfilter %} |
272 {% endfor %} | 272 {% endfor %} |
273 }; | 273 }; |
274 | 274 |
275 {% endif %} | 275 {% endif %} |
276 {% endblock %} | 276 {% endblock %} |
277 {% endif %}{# not is_array_buffer_or_view #} | 277 {% endif %}{# not is_array_buffer_or_view #} |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 {% endif %} | 345 {% endif %} |
346 {% if has_access_check_callbacks %} | 346 {% if has_access_check_callbacks %} |
347 instanceTemplate->SetAccessCheckCallbacks({{cpp_class}}V8Internal::namedSecu
rityCheck, {{cpp_class}}V8Internal::indexedSecurityCheck, v8::External::New(isol
ate, const_cast<WrapperTypeInfo*>(&{{v8_class}}::wrapperTypeInfo))); | 347 instanceTemplate->SetAccessCheckCallbacks({{cpp_class}}V8Internal::namedSecu
rityCheck, {{cpp_class}}V8Internal::indexedSecurityCheck, v8::External::New(isol
ate, const_cast<WrapperTypeInfo*>(&{{v8_class}}::wrapperTypeInfo))); |
348 {% endif %} | 348 {% endif %} |
349 {% for attribute in attributes | 349 {% for attribute in attributes |
350 if attribute.runtime_enabled_function and | 350 if attribute.runtime_enabled_function and |
351 not attribute.exposed_test %} | 351 not attribute.exposed_test %} |
352 {% filter conditional(attribute.conditional_string) %} | 352 {% filter conditional(attribute.conditional_string) %} |
353 if ({{attribute.runtime_enabled_function}}()) { | 353 if ({{attribute.runtime_enabled_function}}()) { |
354 {% if attribute.is_data_type_property %} | 354 {% if attribute.is_data_type_property %} |
355 static const V8DOMConfiguration::AttributeConfiguration attributeConfigu
ration = \ | 355 const V8DOMConfiguration::AttributeConfiguration attributeConfiguration
= \ |
356 {{attribute_configuration(attribute)}}; | 356 {{attribute_configuration(attribute)}}; |
357 V8DOMConfiguration::installAttribute(isolate, instanceTemplate, prototyp
eTemplate, attributeConfiguration); | 357 V8DOMConfiguration::installAttribute(isolate, instanceTemplate, prototyp
eTemplate, attributeConfiguration); |
358 {% else %} | 358 {% else %} |
359 static const V8DOMConfiguration::AccessorConfiguration accessorConfigura
tion = \ | 359 const V8DOMConfiguration::AccessorConfiguration accessorConfiguration =
\ |
360 {{attribute_configuration(attribute)}}; | 360 {{attribute_configuration(attribute)}}; |
361 V8DOMConfiguration::installAccessor(isolate, instanceTemplate, prototype
Template, functionTemplate, defaultSignature, accessorConfiguration); | 361 V8DOMConfiguration::installAccessor(isolate, instanceTemplate, prototype
Template, functionTemplate, defaultSignature, accessorConfiguration); |
362 {% endif %} | 362 {% endif %} |
363 } | 363 } |
364 {% endfilter %} | 364 {% endfilter %} |
365 {% endfor %} | 365 {% endfor %} |
366 {% if constants %} | 366 {% if constants %} |
367 {{install_constants() | indent}} | 367 {{install_constants() | indent}} |
368 {% endif %} | 368 {% endif %} |
369 {# Special operations #} | 369 {# Special operations #} |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
420 {% if not is_override_builtins %} | 420 {% if not is_override_builtins %} |
421 flags |= static_cast<int>(v8::PropertyHandlerFlags::kNonMasking); | 421 flags |= static_cast<int>(v8::PropertyHandlerFlags::kNonMasking); |
422 {% endif %} | 422 {% endif %} |
423 v8::NamedPropertyHandlerConfiguration config({{named_property_getter_cal
lback}}, {{named_property_setter_callback}}, {{named_property_query_callback}},
{{named_property_deleter_callback}}, {{named_property_enumerator_callback}}, v8:
:Handle<v8::Value>(), static_cast<v8::PropertyHandlerFlags>(flags)); | 423 v8::NamedPropertyHandlerConfiguration config({{named_property_getter_cal
lback}}, {{named_property_setter_callback}}, {{named_property_query_callback}},
{{named_property_deleter_callback}}, {{named_property_enumerator_callback}}, v8:
:Handle<v8::Value>(), static_cast<v8::PropertyHandlerFlags>(flags)); |
424 functionTemplate->{{set_on_template}}()->SetHandler(config); | 424 functionTemplate->{{set_on_template}}()->SetHandler(config); |
425 } | 425 } |
426 {% endif %} | 426 {% endif %} |
427 {% if iterator_method %} | 427 {% if iterator_method %} |
428 {% filter exposed(iterator_method.exposed_test) %} | 428 {% filter exposed(iterator_method.exposed_test) %} |
429 {% filter runtime_enabled(iterator_method.runtime_enabled_function) %} | 429 {% filter runtime_enabled(iterator_method.runtime_enabled_function) %} |
430 static const V8DOMConfiguration::SymbolKeyedMethodConfiguration symbolKeyedI
teratorConfiguration = { v8::Symbol::GetIterator, {{cpp_class_or_partial}}V8Inte
rnal::iteratorMethodCallback, 0, V8DOMConfiguration::ExposedToAllScripts }; | 430 const V8DOMConfiguration::SymbolKeyedMethodConfiguration symbolKeyedIterator
Configuration = { v8::Symbol::GetIterator, {{cpp_class_or_partial}}V8Internal::i
teratorMethodCallback, 0, V8DOMConfiguration::ExposedToAllScripts }; |
431 V8DOMConfiguration::installMethod(isolate, prototypeTemplate, defaultSignatu
re, v8::DontDelete, symbolKeyedIteratorConfiguration); | 431 V8DOMConfiguration::installMethod(isolate, prototypeTemplate, defaultSignatu
re, v8::DontDelete, symbolKeyedIteratorConfiguration); |
432 {% endfilter %}{# runtime_enabled() #} | 432 {% endfilter %}{# runtime_enabled() #} |
433 {% endfilter %}{# exposed() #} | 433 {% endfilter %}{# exposed() #} |
434 {% endif %} | 434 {% endif %} |
435 {# End special operations #} | 435 {# End special operations #} |
436 {% if has_custom_legacy_call_as_function %} | 436 {% if has_custom_legacy_call_as_function %} |
437 functionTemplate->InstanceTemplate()->SetCallAsFunctionHandler({{v8_class}}:
:legacyCallCustom); | 437 functionTemplate->InstanceTemplate()->SetCallAsFunctionHandler({{v8_class}}:
:legacyCallCustom); |
438 {% endif %} | 438 {% endif %} |
439 {% if interface_name == 'HTMLAllCollection' %} | 439 {% if interface_name == 'HTMLAllCollection' %} |
440 {# Needed for legacy support of document.all #} | 440 {# Needed for legacy support of document.all #} |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
494 {% endfor %} | 494 {% endfor %} |
495 {% for attribute in attributes if attribute.is_implemented_in_private_script %} | 495 {% for attribute in attributes if attribute.is_implemented_in_private_script %} |
496 {{attribute_getter_implemented_in_private_script(attribute)}} | 496 {{attribute_getter_implemented_in_private_script(attribute)}} |
497 {% if attribute.has_setter %} | 497 {% if attribute.has_setter %} |
498 {{attribute_setter_implemented_in_private_script(attribute)}} | 498 {{attribute_setter_implemented_in_private_script(attribute)}} |
499 {% endif %} | 499 {% endif %} |
500 {% endfor %} | 500 {% endfor %} |
501 {% block partial_interface %}{% endblock %} | 501 {% block partial_interface %}{% endblock %} |
502 } // namespace blink | 502 } // namespace blink |
503 {% endfilter %} | 503 {% endfilter %} |
OLD | NEW |