Call AdjustAmountOfExternalAllocatedMemory when V8ArrayBuffer constructed and destructed
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 21 Aug 2012 22:32:32 +0000 (22:32 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 21 Aug 2012 22:32:32 +0000 (22:32 +0000)
commitda9ffab5fe44c0c56808f4888db35d2971a3a113
tree7227e8624af63df4191c6ab7e754a36fa3e256d7
parent0228bbd262c77f97b42f9900c8a86d5dc0a04bca
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
ChangeLog
ManualTests/typed-array-memory.html [new file with mode: 0644]
Source/WTF/ChangeLog
Source/WTF/wtf/ArrayBuffer.h
Source/WebCore/ChangeLog
Source/WebCore/WebCore.gypi
Source/WebCore/bindings/v8/custom/V8ArrayBufferCustom.cpp
Source/WebCore/bindings/v8/custom/V8ArrayBufferCustom.h [new file with mode: 0644]
Source/WebCore/bindings/v8/custom/V8ArrayBufferViewCustom.cpp
Source/WebCore/bindings/v8/custom/V8ArrayBufferViewCustom.h