OLD | NEW |
1 {% extends 'interface_base.cpp' %} | 1 {% extends 'interface_base.cpp' %} |
2 | 2 |
3 | 3 |
4 {##############################################################################} | 4 {##############################################################################} |
5 {% block indexed_property_getter %} | 5 {% block indexed_property_getter %} |
6 {% if indexed_property_getter and not indexed_property_getter.is_custom %} | 6 {% if indexed_property_getter and not indexed_property_getter.is_custom %} |
7 {% set getter = indexed_property_getter %} | 7 {% set getter = indexed_property_getter %} |
8 static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo
<v8::Value>& info) | 8 static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo
<v8::Value>& info) |
9 { | 9 { |
10 {{cpp_class}}* impl = {{v8_class}}::toImpl(info.Holder()); | 10 {{cpp_class}}* impl = {{v8_class}}::toImpl(info.Holder()); |
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
449 } | 449 } |
450 | 450 |
451 {% endif %} | 451 {% endif %} |
452 {% endblock %} | 452 {% endblock %} |
453 | 453 |
454 | 454 |
455 {##############################################################################} | 455 {##############################################################################} |
456 {% block named_constructor %} | 456 {% block named_constructor %} |
457 {% from 'methods.cpp' import generate_constructor with context %} | 457 {% from 'methods.cpp' import generate_constructor with context %} |
458 {% if named_constructor %} | 458 {% if named_constructor %} |
| 459 {% set to_active_scriptwrappable = '%s::toActiveScriptWrappable' % v8_class |
| 460 if requires_finalizer else '0' %} |
459 // Suppress warning: global constructors, because struct WrapperTypeInfo is triv
ial | 461 // Suppress warning: global constructors, because struct WrapperTypeInfo is triv
ial |
460 // and does not depend on another global objects. | 462 // and does not depend on another global objects. |
461 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) | 463 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) |
462 #pragma clang diagnostic push | 464 #pragma clang diagnostic push |
463 #pragma clang diagnostic ignored "-Wglobal-constructors" | 465 #pragma clang diagnostic ignored "-Wglobal-constructors" |
464 #endif | 466 #endif |
465 const WrapperTypeInfo {{v8_class}}Constructor::wrapperTypeInfo = { gin::kEmbedde
rBlink, {{v8_class}}Constructor::domTemplate, {{v8_class}}::refObject, {{v8_clas
s}}::derefObject, {{v8_class}}::trace, 0, {{v8_class}}::preparePrototypeAndInter
faceObject, {{v8_class}}::installConditionallyEnabledProperties, "{{interface_na
me}}", 0, WrapperTypeInfo::WrapperTypeObjectPrototype, WrapperTypeInfo::{{wrappe
r_class_id}}, WrapperTypeInfo::{{event_target_inheritance}}, WrapperTypeInfo::{{
lifetime}}, WrapperTypeInfo::{{gc_type}} }; | 467 const WrapperTypeInfo {{v8_class}}Constructor::wrapperTypeInfo = { gin::kEmbedde
rBlink, {{v8_class}}Constructor::domTemplate, {{v8_class}}::refObject, {{v8_clas
s}}::derefObject, {{v8_class}}::trace, {{to_active_scriptwrappable}}, 0, {{v8_cl
ass}}::preparePrototypeAndInterfaceObject, {{v8_class}}::installConditionallyEna
bledProperties, "{{interface_name}}", 0, WrapperTypeInfo::WrapperTypeObjectProto
type, WrapperTypeInfo::{{wrapper_class_id}}, WrapperTypeInfo::{{event_target_inh
eritance}}, WrapperTypeInfo::{{lifetime}}, WrapperTypeInfo::{{gc_type}} }; |
466 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) | 468 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) |
467 #pragma clang diagnostic pop | 469 #pragma clang diagnostic pop |
468 #endif | 470 #endif |
469 | 471 |
470 {{generate_constructor(named_constructor)}} | 472 {{generate_constructor(named_constructor)}} |
471 v8::Local<v8::FunctionTemplate> {{v8_class}}Constructor::domTemplate(v8::Isolate
* isolate) | 473 v8::Local<v8::FunctionTemplate> {{v8_class}}Constructor::domTemplate(v8::Isolate
* isolate) |
472 { | 474 { |
473 static int domTemplateKey; // This address is used for a key to look up the
dom template. | 475 static int domTemplateKey; // This address is used for a key to look up the
dom template. |
474 V8PerIsolateData* data = V8PerIsolateData::from(isolate); | 476 V8PerIsolateData* data = V8PerIsolateData::from(isolate); |
475 v8::Local<v8::FunctionTemplate> result = data->existingDOMTemplate(&domTempl
ateKey); | 477 v8::Local<v8::FunctionTemplate> result = data->existingDOMTemplate(&domTempl
ateKey); |
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
900 {% for attribute in attributes if attribute.exposed_test and attribute.on_protot
ype %} | 902 {% for attribute in attributes if attribute.exposed_test and attribute.on_protot
ype %} |
901 {% filter exposed(attribute.exposed_test) %} | 903 {% filter exposed(attribute.exposed_test) %} |
902 const V8DOMConfiguration::AccessorConfiguration accessorConfiguration = {{attrib
ute_configuration(attribute)}}; | 904 const V8DOMConfiguration::AccessorConfiguration accessorConfiguration = {{attrib
ute_configuration(attribute)}}; |
903 V8DOMConfiguration::installAccessor(isolate, v8::Local<v8::Object>(), prototypeO
bject, interfaceObject, signature, accessorConfiguration); | 905 V8DOMConfiguration::installAccessor(isolate, v8::Local<v8::Object>(), prototypeO
bject, interfaceObject, signature, accessorConfiguration); |
904 {% endfilter %} | 906 {% endfilter %} |
905 {% endfor %} | 907 {% endfor %} |
906 {% endmacro %} | 908 {% endmacro %} |
907 | 909 |
908 | 910 |
909 {##############################################################################} | 911 {##############################################################################} |
| 912 {% block to_active_scriptwrappable %} |
| 913 {% if requires_finalizer %} |
| 914 ActiveScriptWrappable* {{v8_class}}::toActiveScriptWrappable(v8::Local<v8::Objec
t> wrapper) |
| 915 { |
| 916 return toImpl(wrapper); |
| 917 } |
| 918 |
| 919 {% endif %} |
| 920 {% endblock %} |
| 921 |
| 922 |
| 923 {##############################################################################} |
910 {% block ref_object_and_deref_object %} | 924 {% block ref_object_and_deref_object %} |
911 void {{v8_class}}::refObject(ScriptWrappable* scriptWrappable) | 925 void {{v8_class}}::refObject(ScriptWrappable* scriptWrappable) |
912 { | 926 { |
913 {% if gc_type == 'WillBeGarbageCollectedObject' %} | 927 {% if gc_type == 'WillBeGarbageCollectedObject' %} |
914 #if !ENABLE(OILPAN) | 928 #if !ENABLE(OILPAN) |
915 scriptWrappable->toImpl<{{cpp_class}}>()->ref(); | 929 scriptWrappable->toImpl<{{cpp_class}}>()->ref(); |
916 #endif | 930 #endif |
917 {% elif gc_type == 'RefCountedObject' %} | 931 {% elif gc_type == 'RefCountedObject' %} |
918 scriptWrappable->toImpl<{{cpp_class}}>()->ref(); | 932 scriptWrappable->toImpl<{{cpp_class}}>()->ref(); |
919 {% endif %} | 933 {% endif %} |
(...skipping 26 matching lines...) Expand all Loading... |
946 | 960 |
947 {% for method in methods if method.overloads and method.overloads.has_partial_ov
erloads %} | 961 {% for method in methods if method.overloads and method.overloads.has_partial_ov
erloads %} |
948 void {{v8_class}}::register{{method.name | blink_capitalize}}MethodForPartialInt
erface(void (*method)(const v8::FunctionCallbackInfo<v8::Value>&)) | 962 void {{v8_class}}::register{{method.name | blink_capitalize}}MethodForPartialInt
erface(void (*method)(const v8::FunctionCallbackInfo<v8::Value>&)) |
949 { | 963 { |
950 {{cpp_class}}V8Internal::{{method.name}}MethodForPartialInterface = method; | 964 {{cpp_class}}V8Internal::{{method.name}}MethodForPartialInterface = method; |
951 } | 965 } |
952 | 966 |
953 {% endfor %} | 967 {% endfor %} |
954 {% endif %} | 968 {% endif %} |
955 {% endblock %} | 969 {% endblock %} |
OLD | NEW |