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

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

Issue 2265873003: binding: Moves hasPendingActivity from ActiveScriptWrappable to ScriptWrappable. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed review comments. Created 4 years, 4 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
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 460 matching lines...) Expand 10 before | Expand all | Expand 10 after
471 } 471 }
472 472
473 {% endif %} 473 {% endif %}
474 {% endblock %} 474 {% endblock %}
475 475
476 476
477 {##############################################################################} 477 {##############################################################################}
478 {% block named_constructor %} 478 {% block named_constructor %}
479 {% from 'methods.cpp' import generate_constructor with context %} 479 {% from 'methods.cpp' import generate_constructor with context %}
480 {% if named_constructor %} 480 {% if named_constructor %}
481 {% set to_active_scriptwrappable = '%s::toActiveScriptWrappable' % v8_class 481 {% set active_scriptwrappable_inheritance =
482 if active_scriptwrappable else '0' %} 482 'InheritFromActiveScriptWrappable'
483 if active_scriptwrappable else
484 'NotInheritFromActiveScriptWrappable' %}
483 // Suppress warning: global constructors, because struct WrapperTypeInfo is triv ial 485 // Suppress warning: global constructors, because struct WrapperTypeInfo is triv ial
484 // and does not depend on another global objects. 486 // and does not depend on another global objects.
485 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) 487 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG)
486 #pragma clang diagnostic push 488 #pragma clang diagnostic push
487 #pragma clang diagnostic ignored "-Wglobal-constructors" 489 #pragma clang diagnostic ignored "-Wglobal-constructors"
488 #endif 490 #endif
489 const WrapperTypeInfo {{v8_class}}Constructor::wrapperTypeInfo = { gin::kEmbedde rBlink, {{v8_class}}Constructor::domTemplate, {{v8_class}}::trace, {{v8_class}}: :traceWrappers, {{to_active_scriptwrappable}}, 0, {{v8_class}}::preparePrototype AndInterfaceObject,{% if has_conditional_attributes_on_instance %} {{v8_class}}: :installConditionallyEnabledProperties{% else %} nullptr{% endif %}, "{{interfac e_name}}", 0, WrapperTypeInfo::WrapperTypeObjectPrototype, WrapperTypeInfo::{{wr apper_class_id}}, WrapperTypeInfo::{{event_target_inheritance}}, WrapperTypeInfo ::{{lifetime}} }; 491 const WrapperTypeInfo {{v8_class}}Constructor::wrapperTypeInfo = { gin::kEmbedde rBlink, {{v8_class}}Constructor::domTemplate, {{v8_class}}::trace, {{v8_class}}: :traceWrappers, 0, {{v8_class}}::preparePrototypeAndInterfaceObject,{% if has_co nditional_attributes_on_instance %} {{v8_class}}::installConditionallyEnabledPro perties{% else %} nullptr{% endif %}, "{{interface_name}}", 0, WrapperTypeInfo:: WrapperTypeObjectPrototype, WrapperTypeInfo::{{wrapper_class_id}}, WrapperTypeIn fo::{{active_scriptwrappable_inheritance}}, WrapperTypeInfo::{{event_target_inhe ritance}}, WrapperTypeInfo::{{lifetime}} };
490 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) 492 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG)
491 #pragma clang diagnostic pop 493 #pragma clang diagnostic pop
492 #endif 494 #endif
493 495
494 {{generate_constructor(named_constructor)}} 496 {{generate_constructor(named_constructor)}}
495 v8::Local<v8::FunctionTemplate> {{v8_class}}Constructor::domTemplate(v8::Isolate * isolate, const DOMWrapperWorld& world) 497 v8::Local<v8::FunctionTemplate> {{v8_class}}Constructor::domTemplate(v8::Isolate * isolate, const DOMWrapperWorld& world)
496 { 498 {
497 static int domTemplateKey; // This address is used for a key to look up the dom template. 499 static int domTemplateKey; // This address is used for a key to look up the dom template.
498 V8PerIsolateData* data = V8PerIsolateData::from(isolate); 500 V8PerIsolateData* data = V8PerIsolateData::from(isolate);
499 v8::Local<v8::FunctionTemplate> result = data->findInterfaceTemplate(world, &domTemplateKey); 501 v8::Local<v8::FunctionTemplate> result = data->findInterfaceTemplate(world, &domTemplateKey);
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
918 const V8DOMConfiguration::AccessorConfiguration accessorConfiguration = {{attrib ute_configuration(attribute)}}; 920 const V8DOMConfiguration::AccessorConfiguration accessorConfiguration = {{attrib ute_configuration(attribute)}};
919 V8DOMConfiguration::installAccessor(isolate, world, v8::Local<v8::Object>(), pro totypeObject, interfaceObject, signature, accessorConfiguration); 921 V8DOMConfiguration::installAccessor(isolate, world, v8::Local<v8::Object>(), pro totypeObject, interfaceObject, signature, accessorConfiguration);
920 {% endfilter %}{# runtime_enabled #} 922 {% endfilter %}{# runtime_enabled #}
921 {% endfilter %}{# secure_context #} 923 {% endfilter %}{# secure_context #}
922 {% endfilter %}{# exposed #} 924 {% endfilter %}{# exposed #}
923 {% endfor %} 925 {% endfor %}
924 {% endmacro %} 926 {% endmacro %}
925 927
926 928
927 {##############################################################################} 929 {##############################################################################}
928 {% block to_active_scriptwrappable %}
929 {% if active_scriptwrappable %}
930 ActiveScriptWrappable* {{v8_class}}::toActiveScriptWrappable(v8::Local<v8::Objec t> wrapper)
931 {
932 return toImpl(wrapper);
933 }
934
935 {% endif %}
936 {% endblock %}
937
938
939 {##############################################################################}
940 {% block partial_interface %} 930 {% block partial_interface %}
941 {% if has_partial_interface %} 931 {% if has_partial_interface %}
942 InstallTemplateFunction {{v8_class}}::install{{v8_class}}TemplateFunction = (Ins tallTemplateFunction)&{{v8_class}}::install{{v8_class}}Template; 932 InstallTemplateFunction {{v8_class}}::install{{v8_class}}TemplateFunction = (Ins tallTemplateFunction)&{{v8_class}}::install{{v8_class}}Template;
943 933
944 void {{v8_class}}::updateWrapperTypeInfo(InstallTemplateFunction installTemplate Function, PreparePrototypeAndInterfaceObjectFunction preparePrototypeAndInterfac eObjectFunction) 934 void {{v8_class}}::updateWrapperTypeInfo(InstallTemplateFunction installTemplate Function, PreparePrototypeAndInterfaceObjectFunction preparePrototypeAndInterfac eObjectFunction)
945 { 935 {
946 {{v8_class}}::install{{v8_class}}TemplateFunction = installTemplateFunction; 936 {{v8_class}}::install{{v8_class}}TemplateFunction = installTemplateFunction;
947 if (preparePrototypeAndInterfaceObjectFunction) 937 if (preparePrototypeAndInterfaceObjectFunction)
948 {{v8_class}}::wrapperTypeInfo.preparePrototypeAndInterfaceObjectFunction = preparePrototypeAndInterfaceObjectFunction; 938 {{v8_class}}::wrapperTypeInfo.preparePrototypeAndInterfaceObjectFunction = preparePrototypeAndInterfaceObjectFunction;
949 } 939 }
950 940
951 {% for method in methods if method.overloads and method.overloads.has_partial_ov erloads %} 941 {% for method in methods if method.overloads and method.overloads.has_partial_ov erloads %}
952 void {{v8_class}}::register{{method.name | blink_capitalize}}MethodForPartialInt erface(void (*method)(const v8::FunctionCallbackInfo<v8::Value>&)) 942 void {{v8_class}}::register{{method.name | blink_capitalize}}MethodForPartialInt erface(void (*method)(const v8::FunctionCallbackInfo<v8::Value>&))
953 { 943 {
954 {{cpp_class}}V8Internal::{{method.name}}MethodForPartialInterface = method; 944 {{cpp_class}}V8Internal::{{method.name}}MethodForPartialInterface = method;
955 } 945 }
956 946
957 {% endfor %} 947 {% endfor %}
958 {% endif %} 948 {% endif %}
959 {% endblock %} 949 {% endblock %}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698