Call AdjustAmountOfExternalAllocatedMemory when V8ArrayBuffer constructed and destructed
https://bugs.webkit.org/show_bug.cgi?id=92993
Patch by Ulan Degenbaev <ulan@chromium.org> on 2012-08-21
Reviewed by Kenneth Russell.
Call AdjustAmountOfExternalAllocatedMemory when V8ArrayBuffer
is constructed and destructed so that V8's garbage collection
heuristics can account for the memory held by these objects.
.:
* ManualTests/typed-array-memory.html: Added.
Source/WebCore:
* WebCore.gypi:
* bindings/v8/SerializedScriptValue.cpp:
* bindings/v8/custom/V8ArrayBufferCustom.cpp:
(WebCore::V8ArrayBufferDeallocationObserver::instance):
(WebCore):
(WebCore::V8ArrayBuffer::constructorCallback):
* bindings/v8/custom/V8ArrayBufferCustom.h: Added.
(WebCore):
* bindings/v8/custom/V8ArrayBufferViewCustom.cpp:
* bindings/v8/custom/V8ArrayBufferViewCustom.h:
(WebCore::constructWebGLArray):
* dom/MessageEvent.cpp:
(WebCore::MessageEvent::MessageEvent):
(WebCore::MessageEvent::initMessageEvent):
Source/WTF:
* wtf/ArrayBuffer.h:
(WTF):
(ArrayBufferDeallocationObserver):
(WTF::ArrayBufferContents::ArrayBufferContents):
(WTF::ArrayBufferContents::transfer):
(ArrayBufferContents):
(ArrayBuffer):
(WTF::ArrayBuffer::setDeallocationObserver):
(WTF::ArrayBufferContents::~ArrayBufferContents):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@126196
268f45cc-cd09-0410-ab3c-
d52691b4dbfc