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 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 {% endif %} | 425 {% endif %} |
426 {% endblock %} | 426 {% endblock %} |
427 | 427 |
428 | 428 |
429 {##############################################################################} | 429 {##############################################################################} |
430 {% block named_constructor %} | 430 {% block named_constructor %} |
431 {% from 'methods.cpp' import generate_constructor with context %} | 431 {% from 'methods.cpp' import generate_constructor with context %} |
432 {% if named_constructor %} | 432 {% if named_constructor %} |
433 {% set to_active_dom_object = '%s::toActiveDOMObject' % v8_class | 433 {% set to_active_dom_object = '%s::toActiveDOMObject' % v8_class |
434 if is_active_dom_object else '0' %} | 434 if is_active_dom_object else '0' %} |
435 {% set to_event_target = '%s::toEventTarget' % v8_class | 435 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_dom_object}}, 0, {{v8_class}}
::installConditionallyEnabledMethods, {{v8_class}}::installConditionallyEnabledP
roperties, 0, WrapperTypeInfo::WrapperTypeObjectPrototype, WrapperTypeInfo::{{wr
apper_class_id}}, WrapperTypeInfo::{{event_target_inheritance}}, WrapperTypeInfo
::{{lifetime}}, WrapperTypeInfo::{{gc_type}} }; |
436 if is_event_target else '0' %} | |
437 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_dom_object}}, {{to_event_targ
et}}, 0, {{v8_class}}::installConditionallyEnabledMethods, {{v8_class}}::install
ConditionallyEnabledProperties, 0, WrapperTypeInfo::WrapperTypeObjectPrototype,
WrapperTypeInfo::{{wrapper_class_id}}, WrapperTypeInfo::{{lifetime}}, WrapperTyp
eInfo::{{gc_type}} }; | |
438 | 436 |
439 {{generate_constructor(named_constructor)}} | 437 {{generate_constructor(named_constructor)}} |
440 v8::Handle<v8::FunctionTemplate> {{v8_class}}Constructor::domTemplate(v8::Isolat
e* isolate) | 438 v8::Handle<v8::FunctionTemplate> {{v8_class}}Constructor::domTemplate(v8::Isolat
e* isolate) |
441 { | 439 { |
442 static int domTemplateKey; // This address is used for a key to look up the
dom template. | 440 static int domTemplateKey; // This address is used for a key to look up the
dom template. |
443 V8PerIsolateData* data = V8PerIsolateData::from(isolate); | 441 V8PerIsolateData* data = V8PerIsolateData::from(isolate); |
444 v8::Local<v8::FunctionTemplate> result = data->existingDOMTemplate(&domTempl
ateKey); | 442 v8::Local<v8::FunctionTemplate> result = data->existingDOMTemplate(&domTempl
ateKey); |
445 if (!result.IsEmpty()) | 443 if (!result.IsEmpty()) |
446 return result; | 444 return result; |
447 | 445 |
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
889 ActiveDOMObject* {{v8_class}}::toActiveDOMObject(v8::Handle<v8::Object> wrapper) | 887 ActiveDOMObject* {{v8_class}}::toActiveDOMObject(v8::Handle<v8::Object> wrapper) |
890 { | 888 { |
891 return toImpl(wrapper); | 889 return toImpl(wrapper); |
892 } | 890 } |
893 | 891 |
894 {% endif %} | 892 {% endif %} |
895 {% endblock %} | 893 {% endblock %} |
896 | 894 |
897 | 895 |
898 {##############################################################################} | 896 {##############################################################################} |
899 {% block to_event_target %} | |
900 {% if is_event_target %} | |
901 EventTarget* {{v8_class}}::toEventTarget(v8::Handle<v8::Object> object) | |
902 { | |
903 return toImpl(object); | |
904 } | |
905 | |
906 {% endif %} | |
907 {% endblock %} | |
908 | |
909 | |
910 {##############################################################################} | |
911 {% block get_shadow_object_template %} | 897 {% block get_shadow_object_template %} |
912 {% if interface_name == 'Window' %} | 898 {% if interface_name == 'Window' %} |
913 v8::Handle<v8::ObjectTemplate> V8Window::getShadowObjectTemplate(v8::Isolate* is
olate) | 899 v8::Handle<v8::ObjectTemplate> V8Window::getShadowObjectTemplate(v8::Isolate* is
olate) |
914 { | 900 { |
915 if (DOMWrapperWorld::current(isolate).isMainWorld()) { | 901 if (DOMWrapperWorld::current(isolate).isMainWorld()) { |
916 DEFINE_STATIC_LOCAL(v8::Persistent<v8::ObjectTemplate>, V8WindowShadowOb
jectCacheForMainWorld, ()); | 902 DEFINE_STATIC_LOCAL(v8::Persistent<v8::ObjectTemplate>, V8WindowShadowOb
jectCacheForMainWorld, ()); |
917 if (V8WindowShadowObjectCacheForMainWorld.IsEmpty()) { | 903 if (V8WindowShadowObjectCacheForMainWorld.IsEmpty()) { |
918 TRACE_EVENT_SCOPED_SAMPLING_STATE("blink", "BuildDOMTemplate"); | 904 TRACE_EVENT_SCOPED_SAMPLING_STATE("blink", "BuildDOMTemplate"); |
919 v8::Handle<v8::ObjectTemplate> templ = v8::ObjectTemplate::New(isola
te); | 905 v8::Handle<v8::ObjectTemplate> templ = v8::ObjectTemplate::New(isola
te); |
920 configureShadowObjectTemplate(templ, isolate); | 906 configureShadowObjectTemplate(templ, isolate); |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
984 } | 970 } |
985 | 971 |
986 {% for method in methods if method.overloads and method.overloads.has_partial_ov
erloads %} | 972 {% for method in methods if method.overloads and method.overloads.has_partial_ov
erloads %} |
987 void {{v8_class}}::register{{method.name | blink_capitalize}}MethodForPartialInt
erface(void (*method)(const v8::FunctionCallbackInfo<v8::Value>&)) | 973 void {{v8_class}}::register{{method.name | blink_capitalize}}MethodForPartialInt
erface(void (*method)(const v8::FunctionCallbackInfo<v8::Value>&)) |
988 { | 974 { |
989 {{cpp_class}}V8Internal::{{method.name}}MethodForPartialInterface = method; | 975 {{cpp_class}}V8Internal::{{method.name}}MethodForPartialInterface = method; |
990 } | 976 } |
991 {% endfor %} | 977 {% endfor %} |
992 {% endif %} | 978 {% endif %} |
993 {% endblock %} | 979 {% endblock %} |
OLD | NEW |