Index: third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl |
diff --git a/third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl b/third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl |
index 9e0e34b4c0b90182edec736c3baa2777d8d7907b..9ad0a0822e7ac4eb0f077e419878e38647889ead 100644 |
--- a/third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl |
+++ b/third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl |
@@ -781,7 +781,8 @@ v8::Local<v8::Object> {{v8_class}}::findInstanceInPrototypeChain(v8::Local<v8::V |
// Transfer the ownership of the allocated memory to an {{interface_name}} without |
// copying. |
v8::{{interface_name}}::Contents v8Contents = v8buffer->Externalize(); |
- WTF::ArrayBufferContents contents(v8Contents.Data(), v8Contents.ByteLength(), WTF::ArrayBufferContents::{% if interface_name == 'ArrayBuffer' %}Not{% endif %}Shared); |
+ WTF::ArrayBufferContents::DataHandle data(v8Contents.Data(), WTF::ArrayBufferContents::freeMemory); |
+ WTF::ArrayBufferContents contents(std::move(data), v8Contents.ByteLength(), WTF::ArrayBufferContents::{% if interface_name == 'ArrayBuffer' %}Not{% endif %}Shared); |
{{cpp_class}}* buffer = {{cpp_class}}::create(contents); |
v8::Local<v8::Object> associatedWrapper = buffer->associateWithWrapper(v8::Isolate::GetCurrent(), buffer->wrapperTypeInfo(), object); |
DCHECK(associatedWrapper == object); |