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 707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
718 if (v8buffer->IsExternal()) { | 718 if (v8buffer->IsExternal()) { |
719 const WrapperTypeInfo* wrapperTypeInfo = toWrapperTypeInfo(object); | 719 const WrapperTypeInfo* wrapperTypeInfo = toWrapperTypeInfo(object); |
720 RELEASE_ASSERT(wrapperTypeInfo); | 720 RELEASE_ASSERT(wrapperTypeInfo); |
721 RELEASE_ASSERT(wrapperTypeInfo->ginEmbedder == gin::kEmbedderBlink); | 721 RELEASE_ASSERT(wrapperTypeInfo->ginEmbedder == gin::kEmbedderBlink); |
722 return toScriptWrappable(object)->toImpl<{{cpp_class}}>(); | 722 return toScriptWrappable(object)->toImpl<{{cpp_class}}>(); |
723 } | 723 } |
724 | 724 |
725 // Transfer the ownership of the allocated memory to an ArrayBuffer without | 725 // Transfer the ownership of the allocated memory to an ArrayBuffer without |
726 // copying. | 726 // copying. |
727 v8::ArrayBuffer::Contents v8Contents = v8buffer->Externalize(); | 727 v8::ArrayBuffer::Contents v8Contents = v8buffer->Externalize(); |
728 WTF::ArrayBufferContents contents(v8Contents.Data(), v8Contents.ByteLength()
, 0); | 728 WTF::ArrayBufferContents contents(v8Contents.Data(), v8Contents.ByteLength()
); |
729 RefPtr<{{cpp_class}}> buffer = {{cpp_class}}::create(contents); | 729 RefPtr<{{cpp_class}}> buffer = {{cpp_class}}::create(contents); |
730 // Since this transfer doesn't allocate new memory, do not call | |
731 // DOMArrayBufferDeallocationObserver::blinkAllocatedMemory. | |
732 buffer->buffer()->setDeallocationObserverWithoutAllocationNotification( | |
733 DOMArrayBufferDeallocationObserver::instance()); | |
734 buffer->associateWithWrapper(v8::Isolate::GetCurrent(), buffer->wrapperTypeI
nfo(), object); | 730 buffer->associateWithWrapper(v8::Isolate::GetCurrent(), buffer->wrapperTypeI
nfo(), object); |
735 | 731 |
736 return buffer.get(); | 732 return buffer.get(); |
737 } | 733 } |
738 | 734 |
739 {% elif interface_name == 'ArrayBufferView' %} | 735 {% elif interface_name == 'ArrayBufferView' %} |
740 {{cpp_class}}* V8ArrayBufferView::toImpl(v8::Local<v8::Object> object) | 736 {{cpp_class}}* V8ArrayBufferView::toImpl(v8::Local<v8::Object> object) |
741 { | 737 { |
742 ASSERT(object->IsArrayBufferView()); | 738 ASSERT(object->IsArrayBufferView()); |
743 ScriptWrappable* scriptWrappable = toScriptWrappable(object); | 739 ScriptWrappable* scriptWrappable = toScriptWrappable(object); |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
943 } | 939 } |
944 | 940 |
945 {% 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 %} |
946 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>&)) |
947 { | 943 { |
948 {{cpp_class}}V8Internal::{{method.name}}MethodForPartialInterface = method; | 944 {{cpp_class}}V8Internal::{{method.name}}MethodForPartialInterface = method; |
949 } | 945 } |
950 {% endfor %} | 946 {% endfor %} |
951 {% endif %} | 947 {% endif %} |
952 {% endblock %} | 948 {% endblock %} |
OLD | NEW |