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

Unified Diff: gin/isolate_holder.cc

Issue 172133002: gin: Make it possible to use gin array buffers when running on top of blink (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updates Created 6 years, 10 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 | « gin/array_buffer.cc ('k') | gin/per_isolate_data.h » ('j') | 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 411f26acec0f586e5e0688341921c2d60e7fdeb6..430a71651bfa4dde6a17764265012068c5b4af6f 100644
--- a/gin/isolate_holder.cc
+++ b/gin/isolate_holder.cc
@@ -53,14 +53,21 @@ IsolateHolder::IsolateHolder()
constraints.ConfigureDefaults(base::SysInfo::AmountOfPhysicalMemory(),
base::SysInfo::NumberOfProcessors());
v8::SetResourceConstraints(isolate_, &constraints);
- Init();
+ Init(ArrayBufferAllocator::SharedInstance());
}
IsolateHolder::IsolateHolder(v8::Isolate* isolate)
: isolate_owner_(false),
isolate_(isolate) {
EnsureV8Initialized(false);
- Init();
+ Init(NULL);
+}
+
+IsolateHolder::IsolateHolder(v8::Isolate* isolate,
+ v8::ArrayBuffer::Allocator* allocator)
+ : isolate_owner_(false), isolate_(isolate) {
+ EnsureV8Initialized(false);
+ Init(allocator);
}
IsolateHolder::~IsolateHolder() {
@@ -69,10 +76,10 @@ IsolateHolder::~IsolateHolder() {
isolate_->Dispose();
}
-void IsolateHolder::Init() {
+void IsolateHolder::Init(v8::ArrayBuffer::Allocator* allocator) {
v8::Isolate::Scope isolate_scope(isolate_);
v8::HandleScope handle_scope(isolate_);
- isolate_data_.reset(new PerIsolateData(isolate_));
+ isolate_data_.reset(new PerIsolateData(isolate_, allocator));
}
} // namespace gin
« no previous file with comments | « gin/array_buffer.cc ('k') | gin/per_isolate_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698