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

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

Issue 1776943002: Register ArrayBufferContents' adjustAmountOfMemory in V8Initializer::initialize (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 | third_party/WebKit/Source/platform/testing/RunAllTests.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp b/third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp
index dd1501af2710f035e4553697828d64e6d7014e23..1bd769e0b71102066956fa0d2b4bbf1cc1843d78 100644
--- a/third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp
@@ -351,10 +351,17 @@ class ArrayBufferAllocator : public v8::ArrayBuffer::Allocator {
} // namespace
+static void adjustAmountOfExternalAllocatedMemory(int size)
+{
+ v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory(size);
+}
+
void V8Initializer::initializeMainThread()
{
ASSERT(isMainThread());
+ WTF::ArrayBufferContents::initialize(adjustAmountOfExternalAllocatedMemory);
+
DEFINE_STATIC_LOCAL(ArrayBufferAllocator, arrayBufferAllocator, ());
auto v8ExtrasMode = RuntimeEnabledFeatures::experimentalV8ExtrasEnabled() ? gin::IsolateHolder::kStableAndExperimentalV8Extras : gin::IsolateHolder::kStableV8Extras;
gin::IsolateHolder::Initialize(gin::IsolateHolder::kNonStrictMode, v8ExtrasMode, &arrayBufferAllocator);
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/testing/RunAllTests.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698