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 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
469 {% endif %} | 469 {% endif %} |
470 {% endblock %} | 470 {% endblock %} |
471 | 471 |
472 | 472 |
473 {##############################################################################} | 473 {##############################################################################} |
474 {% block named_constructor %} | 474 {% block named_constructor %} |
475 {% from 'methods.cpp' import generate_constructor with context %} | 475 {% from 'methods.cpp' import generate_constructor with context %} |
476 {% if named_constructor %} | 476 {% if named_constructor %} |
477 {% set to_active_dom_object = '%s::toActiveDOMObject' % v8_class | 477 {% set to_active_dom_object = '%s::toActiveDOMObject' % v8_class |
478 if is_active_dom_object else '0' %} | 478 if is_active_dom_object else '0' %} |
479 // Suppress warning: global constructors, because struct WrapperTypeInfo is triv ial | |
Nico
2015/06/29 05:23:25
Initializing a global with a dllimported function
tasak
2015/06/29 05:48:25
I see. I will fix the comments.
| |
480 // and does not depend on another global objects. | |
481 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) | |
482 #pragma clang diagnostic push | |
483 #pragma clang diagnostic ignored "-Wglobal-constructors" | |
484 #endif | |
479 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}} ::preparePrototypeObject, {{v8_class}}::installConditionallyEnabledProperties, " {{interface_name}}", 0, WrapperTypeInfo::WrapperTypeObjectPrototype, WrapperType Info::{{wrapper_class_id}}, WrapperTypeInfo::{{event_target_inheritance}}, Wrapp erTypeInfo::{{lifetime}}, WrapperTypeInfo::{{gc_type}} }; | 485 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}} ::preparePrototypeObject, {{v8_class}}::installConditionallyEnabledProperties, " {{interface_name}}", 0, WrapperTypeInfo::WrapperTypeObjectPrototype, WrapperType Info::{{wrapper_class_id}}, WrapperTypeInfo::{{event_target_inheritance}}, Wrapp erTypeInfo::{{lifetime}}, WrapperTypeInfo::{{gc_type}} }; |
486 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) | |
487 #pragma clang diagnostic pop | |
488 #endif | |
480 | 489 |
481 {{generate_constructor(named_constructor)}} | 490 {{generate_constructor(named_constructor)}} |
482 v8::Local<v8::FunctionTemplate> {{v8_class}}Constructor::domTemplate(v8::Isolate * isolate) | 491 v8::Local<v8::FunctionTemplate> {{v8_class}}Constructor::domTemplate(v8::Isolate * isolate) |
483 { | 492 { |
484 static int domTemplateKey; // This address is used for a key to look up the dom template. | 493 static int domTemplateKey; // This address is used for a key to look up the dom template. |
485 V8PerIsolateData* data = V8PerIsolateData::from(isolate); | 494 V8PerIsolateData* data = V8PerIsolateData::from(isolate); |
486 v8::Local<v8::FunctionTemplate> result = data->existingDOMTemplate(&domTempl ateKey); | 495 v8::Local<v8::FunctionTemplate> result = data->existingDOMTemplate(&domTempl ateKey); |
487 if (!result.IsEmpty()) | 496 if (!result.IsEmpty()) |
488 return result; | 497 return result; |
489 | 498 |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
574 } | 583 } |
575 | 584 |
576 {% endif %} | 585 {% endif %} |
577 {% endblock %} | 586 {% endblock %} |
578 | 587 |
579 | 588 |
580 {##############################################################################} | 589 {##############################################################################} |
581 {% block shadow_attributes %} | 590 {% block shadow_attributes %} |
582 {% from 'attributes.cpp' import attribute_configuration with context %} | 591 {% from 'attributes.cpp' import attribute_configuration with context %} |
583 {% if interface_name == 'Window' %} | 592 {% if interface_name == 'Window' %} |
593 // Suppress warning: global constructors, because AttributeConfiguration is triv ial | |
594 // and does not depend on another global objects. | |
595 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) | |
596 #pragma clang diagnostic push | |
597 #pragma clang diagnostic ignored "-Wglobal-constructors" | |
598 #endif | |
584 static const V8DOMConfiguration::AttributeConfiguration shadowAttributes[] = { | 599 static const V8DOMConfiguration::AttributeConfiguration shadowAttributes[] = { |
585 {% for attribute in attributes if attribute.is_unforgeable and attribute.sho uld_be_exposed_to_script %} | 600 {% for attribute in attributes if attribute.is_unforgeable and attribute.sho uld_be_exposed_to_script %} |
586 {{attribute_configuration(attribute)}}, | 601 {{attribute_configuration(attribute)}}, |
587 {% endfor %} | 602 {% endfor %} |
588 }; | 603 }; |
604 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) | |
605 #pragma clang diagnostic pop | |
606 #endif | |
589 | 607 |
590 {% endif %} | 608 {% endif %} |
591 {% endblock %} | 609 {% endblock %} |
592 | 610 |
593 | 611 |
594 {##############################################################################} | 612 {##############################################################################} |
595 {% block constructor_callback %} | 613 {% block constructor_callback %} |
596 {% if constructors or has_custom_constructor or has_event_constructor %} | 614 {% if constructors or has_custom_constructor or has_event_constructor %} |
597 void {{v8_class}}::constructorCallback(const v8::FunctionCallbackInfo<v8::Value> & info) | 615 void {{v8_class}}::constructorCallback(const v8::FunctionCallbackInfo<v8::Value> & info) |
598 { | 616 { |
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
943 } | 961 } |
944 | 962 |
945 {% for method in methods if method.overloads and method.overloads.has_partial_ov erloads %} | 963 {% for method in methods if method.overloads and method.overloads.has_partial_ov erloads %} |
946 void {{v8_class}}::register{{method.name | blink_capitalize}}MethodForPartialInt erface(void (*method)(const v8::FunctionCallbackInfo<v8::Value>&)) | 964 void {{v8_class}}::register{{method.name | blink_capitalize}}MethodForPartialInt erface(void (*method)(const v8::FunctionCallbackInfo<v8::Value>&)) |
947 { | 965 { |
948 {{cpp_class}}V8Internal::{{method.name}}MethodForPartialInterface = method; | 966 {{cpp_class}}V8Internal::{{method.name}}MethodForPartialInterface = method; |
949 } | 967 } |
950 {% endfor %} | 968 {% endfor %} |
951 {% endif %} | 969 {% endif %} |
952 {% endblock %} | 970 {% endblock %} |
OLD | NEW |