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

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

Issue 820183002: [bindings] Make v8_class[Constructor]::domTemplate use Local<> instead of Handle<>. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@new-branch
Patch Set: Created 6 years 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
OLDNEW
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 427 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 438
439 {##############################################################################} 439 {##############################################################################}
440 {% block named_constructor %} 440 {% block named_constructor %}
441 {% from 'methods.cpp' import generate_constructor with context %} 441 {% from 'methods.cpp' import generate_constructor with context %}
442 {% if named_constructor %} 442 {% if named_constructor %}
443 {% set to_active_dom_object = '%s::toActiveDOMObject' % v8_class 443 {% set to_active_dom_object = '%s::toActiveDOMObject' % v8_class
444 if is_active_dom_object else '0' %} 444 if is_active_dom_object else '0' %}
445 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}} }; 445 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}} };
446 446
447 {{generate_constructor(named_constructor)}} 447 {{generate_constructor(named_constructor)}}
448 v8::Handle<v8::FunctionTemplate> {{v8_class}}Constructor::domTemplate(v8::Isolat e* isolate) 448 v8::Local<v8::FunctionTemplate> {{v8_class}}Constructor::domTemplate(v8::Isolate * isolate)
449 { 449 {
450 static int domTemplateKey; // This address is used for a key to look up the dom template. 450 static int domTemplateKey; // This address is used for a key to look up the dom template.
451 V8PerIsolateData* data = V8PerIsolateData::from(isolate); 451 V8PerIsolateData* data = V8PerIsolateData::from(isolate);
452 v8::Local<v8::FunctionTemplate> result = data->existingDOMTemplate(&domTempl ateKey); 452 v8::Local<v8::FunctionTemplate> result = data->existingDOMTemplate(&domTempl ateKey);
453 if (!result.IsEmpty()) 453 if (!result.IsEmpty())
454 return result; 454 return result;
455 455
456 TRACE_EVENT_SCOPED_SAMPLING_STATE("blink", "BuildDOMTemplate"); 456 TRACE_EVENT_SCOPED_SAMPLING_STATE("blink", "BuildDOMTemplate");
457 result = v8::FunctionTemplate::New(isolate, {{v8_class}}ConstructorCallback) ; 457 result = v8::FunctionTemplate::New(isolate, {{v8_class}}ConstructorCallback) ;
458 v8::Local<v8::ObjectTemplate> instanceTemplate = result->InstanceTemplate(); 458 v8::Local<v8::ObjectTemplate> instanceTemplate = result->InstanceTemplate();
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
729 static const V8DOMConfiguration::AttributeConfiguration {{method.name}}OriginSaf eAttributeConfiguration = { 729 static const V8DOMConfiguration::AttributeConfiguration {{method.name}}OriginSaf eAttributeConfiguration = {
730 "{{method.name}}", {{getter_callback}}, {{setter_callback}}, {{getter_callba ck_for_main_world}}, {{setter_callback_for_main_world}}, &{{v8_class}}::wrapperT ypeInfo, v8::ALL_CAN_READ, {{property_attribute}}, {{only_exposed_to_private_scr ipt}}, V8DOMConfiguration::OnInstance, 730 "{{method.name}}", {{getter_callback}}, {{setter_callback}}, {{getter_callba ck_for_main_world}}, {{setter_callback_for_main_world}}, &{{v8_class}}::wrapperT ypeInfo, v8::ALL_CAN_READ, {{property_attribute}}, {{only_exposed_to_private_scr ipt}}, V8DOMConfiguration::OnInstance,
731 }; 731 };
732 V8DOMConfiguration::installAttribute({{method.function_template}}, v8::Handle<v8 ::ObjectTemplate>(), {{method.name}}OriginSafeAttributeConfiguration, isolate); 732 V8DOMConfiguration::installAttribute({{method.function_template}}, v8::Handle<v8 ::ObjectTemplate>(), {{method.name}}OriginSafeAttributeConfiguration, isolate);
733 {%- endmacro %} 733 {%- endmacro %}
734 734
735 735
736 {##############################################################################} 736 {##############################################################################}
737 {% block get_dom_template %} 737 {% block get_dom_template %}
738 {% if not is_array_buffer_or_view %} 738 {% if not is_array_buffer_or_view %}
739 v8::Handle<v8::FunctionTemplate> {{v8_class}}::domTemplate(v8::Isolate* isolate) 739 v8::Local<v8::FunctionTemplate> {{v8_class}}::domTemplate(v8::Isolate* isolate)
740 { 740 {
741 {% if has_partial_interface %} 741 {% if has_partial_interface %}
742 {% set installTemplateFunction = '%s::install%sTemplateFunction' % (v8_class , v8_class) %} 742 {% set installTemplateFunction = '%s::install%sTemplateFunction' % (v8_class , v8_class) %}
743 ASSERT({{installTemplateFunction}} != {{v8_class}}::install{{v8_class}}Templ ate); 743 ASSERT({{installTemplateFunction}} != {{v8_class}}::install{{v8_class}}Templ ate);
744 {% else %} 744 {% else %}
745 {% set installTemplateFunction = 'install%sTemplate' % v8_class %} 745 {% set installTemplateFunction = 'install%sTemplate' % v8_class %}
746 {% endif %} 746 {% endif %}
747 {% set installTemplateFunction = '%s::install%sTemplateFunction' % (v8_class, v8 _class) if has_partial_interface else 'install%sTemplate' % v8_class %} 747 {% set installTemplateFunction = '%s::install%sTemplateFunction' % (v8_class, v8 _class) if has_partial_interface else 'install%sTemplate' % v8_class %}
748 return V8DOMConfiguration::domClassTemplate(isolate, const_cast<WrapperTypeI nfo*>(&wrapperTypeInfo), {{installTemplateFunction}}); 748 return V8DOMConfiguration::domClassTemplate(isolate, const_cast<WrapperTypeI nfo*>(&wrapperTypeInfo), {{installTemplateFunction}});
749 } 749 }
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
970 } 970 }
971 971
972 {% 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 %}
973 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>&))
974 { 974 {
975 {{cpp_class}}V8Internal::{{method.name}}MethodForPartialInterface = method; 975 {{cpp_class}}V8Internal::{{method.name}}MethodForPartialInterface = method;
976 } 976 }
977 {% endfor %} 977 {% endfor %}
978 {% endif %} 978 {% endif %}
979 {% endblock %} 979 {% endblock %}
OLDNEW
« no previous file with comments | « Source/bindings/templates/interface.h ('k') | Source/bindings/tests/results/core/V8SVGTestInterface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698