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

Unified Diff: gin/isolate_holder.cc

Issue 566603002: Use the array buffer allocator from IsolateHolder::Initialize for new Isolates (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gin/isolate_holder.cc
diff --git a/gin/isolate_holder.cc b/gin/isolate_holder.cc
index 8655c4bd7f79f64da7eb98b478ff297847784471..812be4ef7231554138a3cb8d8d37fd49d2572e1c 100644
--- a/gin/isolate_holder.cc
+++ b/gin/isolate_holder.cc
@@ -18,6 +18,7 @@
namespace gin {
namespace {
+v8::ArrayBuffer::Allocator* g_array_buffer_allocator = NULL;
bool GenerateEntropy(unsigned char* buffer, size_t amount) {
base::RandBytes(buffer, amount);
@@ -46,7 +47,7 @@ IsolateHolder::IsolateHolder()
base::SysInfo::AmountOfVirtualMemory(),
base::SysInfo::NumberOfProcessors());
v8::SetResourceConstraints(isolate_, &constraints);
- Init(ArrayBufferAllocator::SharedInstance());
+ Init(g_array_buffer_allocator);
}
IsolateHolder::IsolateHolder(v8::Isolate* isolate,
@@ -70,6 +71,7 @@ void IsolateHolder::Initialize(ScriptMode mode,
return;
v8::V8::InitializePlatform(V8Platform::Get());
v8::V8::SetArrayBufferAllocator(allocator);
+ g_array_buffer_allocator = allocator;
if (mode == gin::IsolateHolder::kStrictMode) {
static const char v8_flags[] = "--use_strict";
v8::V8::SetFlagsFromString(v8_flags, sizeof(v8_flags) - 1);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698