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

Unified Diff: gin/isolate_holder.cc

Issue 2897853002: [gin] Make a new IsolateHolder ctor for snapshot (Closed)
Patch Set: Create SnapshotCreator in IsolateHolder Created 3 years, 7 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 | gin/public/isolate_holder.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 2e707359ca70f51778e179a74c26c95060ed52a1..d42607d86ddea5d4c0915509e1b2dc72ca664176 100644
--- a/gin/isolate_holder.cc
+++ b/gin/isolate_holder.cc
@@ -68,6 +68,30 @@ IsolateHolder::IsolateHolder(
#endif
}
+IsolateHolder::IsolateHolder(intptr_t* reference_table,
+ v8::StartupData* existing_blob)
+ : snapshot_creator_(
+ new v8::SnapshotCreator(reference_table, existing_blob)),
+ access_mode_(kSingleThread) {
+ v8::ArrayBuffer::Allocator* allocator = g_array_buffer_allocator;
+ CHECK(allocator) << "You need to invoke gin::IsolateHolder::Initialize first";
+ isolate_ = snapshot_creator_->GetIsolate();
+ isolate_data_.reset(
+ new PerIsolateData(isolate_, allocator, access_mode_, nullptr));
+ isolate_memory_dump_provider_.reset(new V8IsolateMemoryDumpProvider(this));
+#if defined(OS_WIN)
+ {
+ void* code_range;
+ size_t size;
+ isolate_->GetCodeRange(&code_range, &size);
+ Debug::CodeRangeCreatedCallback callback =
+ DebugImpl::GetCodeRangeCreatedCallback();
+ if (code_range && size && callback)
+ callback(code_range, size);
+ }
+#endif
+}
+
IsolateHolder::~IsolateHolder() {
if (task_observer_.get())
base::MessageLoop::current()->RemoveTaskObserver(task_observer_.get());
« no previous file with comments | « no previous file | gin/public/isolate_holder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698