Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(383)

Unified Diff: Source/bindings/core/v8/V8Initializer.cpp

Issue 1183763003: Remove ArrayBufferDeallocationObserver (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: use injection pattern Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/bindings/scripts/v8_interface.py » ('j') | Source/wtf/ArrayBufferContents.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/core/v8/V8Initializer.cpp
diff --git a/Source/bindings/core/v8/V8Initializer.cpp b/Source/bindings/core/v8/V8Initializer.cpp
index 874d0f1c3ff5454281e787edf3b29145e529d17b..2ce7497a24c177a68fa25f930299f5d583920d1b 100644
--- a/Source/bindings/core/v8/V8Initializer.cpp
+++ b/Source/bindings/core/v8/V8Initializer.cpp
@@ -387,6 +387,11 @@ class ArrayBufferAllocator : public v8::ArrayBuffer::Allocator {
}
};
+void arrayBufferContentsAllocationListener(int size)
+{
+ v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory(size);
+}
+
} // namespace
void V8Initializer::initializeMainThreadIfNeeded()
@@ -400,6 +405,7 @@ void V8Initializer::initializeMainThreadIfNeeded()
DEFINE_STATIC_LOCAL(ArrayBufferAllocator, arrayBufferAllocator, ());
gin::IsolateHolder::Initialize(gin::IsolateHolder::kNonStrictMode, &arrayBufferAllocator);
+ WTF::ArrayBufferContents::setAllocationListener(arrayBufferContentsAllocationListener);
haraken 2015/06/15 17:33:29 I'd move this to initializeWithoutV8 in WebKit.cpp
binji 2015/06/15 19:19:46 Done.
v8::Isolate* isolate = V8PerIsolateData::initialize();
« no previous file with comments | « no previous file | Source/bindings/scripts/v8_interface.py » ('j') | Source/wtf/ArrayBufferContents.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698