OLD | NEW |
1 {% extends 'interface_base.cpp.tmpl' %} | 1 {% extends 'interface_base.cpp.tmpl' %} |
2 | 2 |
3 {% set has_prepare_prototype_and_interface_object = | 3 {% set has_prepare_prototype_and_interface_object = |
4 unscopables or has_conditional_attributes_on_prototype or | 4 unscopables or has_conditional_attributes_on_prototype or |
5 methods | conditionally_exposed(is_partial) %} | 5 methods | conditionally_exposed(is_partial) %} |
6 {% set prepare_prototype_and_interface_object_func = | 6 {% set prepare_prototype_and_interface_object_func = |
7 '%s::preparePrototypeAndInterfaceObject' % v8_class | 7 '%s::preparePrototypeAndInterfaceObject' % v8_class |
8 if has_prepare_prototype_and_interface_object | 8 if has_prepare_prototype_and_interface_object |
9 else 'nullptr' %} | 9 else 'nullptr' %} |
10 | 10 |
(...skipping 763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
774 if (v8buffer->IsExternal()) { | 774 if (v8buffer->IsExternal()) { |
775 const WrapperTypeInfo* wrapperTypeInfo = toWrapperTypeInfo(object); | 775 const WrapperTypeInfo* wrapperTypeInfo = toWrapperTypeInfo(object); |
776 CHECK(wrapperTypeInfo); | 776 CHECK(wrapperTypeInfo); |
777 CHECK_EQ(wrapperTypeInfo->ginEmbedder, gin::kEmbedderBlink); | 777 CHECK_EQ(wrapperTypeInfo->ginEmbedder, gin::kEmbedderBlink); |
778 return toScriptWrappable(object)->toImpl<{{cpp_class}}>(); | 778 return toScriptWrappable(object)->toImpl<{{cpp_class}}>(); |
779 } | 779 } |
780 | 780 |
781 // Transfer the ownership of the allocated memory to an {{interface_name}} wit
hout | 781 // Transfer the ownership of the allocated memory to an {{interface_name}} wit
hout |
782 // copying. | 782 // copying. |
783 v8::{{interface_name}}::Contents v8Contents = v8buffer->Externalize(); | 783 v8::{{interface_name}}::Contents v8Contents = v8buffer->Externalize(); |
784 WTF::ArrayBufferContents contents(v8Contents.Data(), v8Contents.ByteLength(),
WTF::ArrayBufferContents::{% if interface_name == 'ArrayBuffer' %}Not{% endif %}
Shared); | 784 WTF::ArrayBufferContents::DataHandle data(v8Contents.Data(), WTF::ArrayBufferC
ontents::freeMemory); |
| 785 WTF::ArrayBufferContents contents(std::move(data), v8Contents.ByteLength(), WT
F::ArrayBufferContents::{% if interface_name == 'ArrayBuffer' %}Not{% endif %}Sh
ared); |
785 {{cpp_class}}* buffer = {{cpp_class}}::create(contents); | 786 {{cpp_class}}* buffer = {{cpp_class}}::create(contents); |
786 v8::Local<v8::Object> associatedWrapper = buffer->associateWithWrapper(v8::Iso
late::GetCurrent(), buffer->wrapperTypeInfo(), object); | 787 v8::Local<v8::Object> associatedWrapper = buffer->associateWithWrapper(v8::Iso
late::GetCurrent(), buffer->wrapperTypeInfo(), object); |
787 DCHECK(associatedWrapper == object); | 788 DCHECK(associatedWrapper == object); |
788 | 789 |
789 return buffer; | 790 return buffer; |
790 } | 791 } |
791 | 792 |
792 {% elif interface_name == 'ArrayBufferView' %} | 793 {% elif interface_name == 'ArrayBufferView' %} |
793 {{cpp_class}}* V8ArrayBufferView::toImpl(v8::Local<v8::Object> object) { | 794 {{cpp_class}}* V8ArrayBufferView::toImpl(v8::Local<v8::Object> object) { |
794 DCHECK(object->IsArrayBufferView()); | 795 DCHECK(object->IsArrayBufferView()); |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
892 } | 893 } |
893 | 894 |
894 {% for method in methods if method.overloads and method.overloads.has_partial_ov
erloads %} | 895 {% for method in methods if method.overloads and method.overloads.has_partial_ov
erloads %} |
895 void {{v8_class}}::register{{method.name | blink_capitalize}}MethodForPartialInt
erface(void (*method)(const v8::FunctionCallbackInfo<v8::Value>&)) { | 896 void {{v8_class}}::register{{method.name | blink_capitalize}}MethodForPartialInt
erface(void (*method)(const v8::FunctionCallbackInfo<v8::Value>&)) { |
896 {{cpp_class}}V8Internal::{{method.name}}MethodForPartialInterface = method; | 897 {{cpp_class}}V8Internal::{{method.name}}MethodForPartialInterface = method; |
897 } | 898 } |
898 | 899 |
899 {% endfor %} | 900 {% endfor %} |
900 {% endif %} | 901 {% endif %} |
901 {% endblock %} | 902 {% endblock %} |
OLD | NEW |