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

Unified Diff: gin/public/isolate_holder.h

Issue 2841443005: [Bindings] Create and use V8 context snapshots (Closed)
Patch Set: . Created 3 years, 8 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
Index: gin/public/isolate_holder.h
diff --git a/gin/public/isolate_holder.h b/gin/public/isolate_holder.h
index 0d9cb3b39ef17561c090cf57d0f8dc916a67f0c7..6486c1fccce6cd4f8aa793af7a1e8cd9f2895748 100644
--- a/gin/public/isolate_holder.h
+++ b/gin/public/isolate_holder.h
@@ -53,13 +53,21 @@ class GIN_EXPORT IsolateHolder {
kStableAndExperimentalV8Extras,
};
+ enum V8ContextMode {
+ kDefault,
+ kTakeSnapshot,
+ kUseSnapshot,
+ };
+
explicit IsolateHolder(
scoped_refptr<base::SingleThreadTaskRunner> task_runner);
IsolateHolder(scoped_refptr<base::SingleThreadTaskRunner> task_runner,
AccessMode access_mode);
IsolateHolder(scoped_refptr<base::SingleThreadTaskRunner> task_runner,
AccessMode access_mode,
- AllowAtomicsWaitMode atomics_wait_mode);
+ AllowAtomicsWaitMode atomics_wait_mode,
+ intptr_t*,
Yuki 2017/04/28 13:48:27 Write the parameter name, e.g. snapshot_external_r
peria 2017/06/01 08:33:31 Done.
+ V8ContextMode);
~IsolateHolder();
// Should be invoked once before creating IsolateHolder instances to
@@ -75,6 +83,7 @@ class GIN_EXPORT IsolateHolder {
v8::ArrayBuffer::Allocator* allocator);
v8::Isolate* isolate() { return isolate_; }
+ v8::SnapshotCreator* snapshot_creator() { return snapshot_creator_.get(); }
// The implementations of Object.observe() and Promise enqueue v8 Microtasks
// that should be executed just before control is returned to the message
@@ -100,12 +109,17 @@ class GIN_EXPORT IsolateHolder {
return isolate_memory_dump_provider_.get();
}
+ V8ContextMode v8_context_mode() const { return v8_context_mode_; }
+
private:
v8::Isolate* isolate_;
+ std::unique_ptr<v8::SnapshotCreator> snapshot_creator_;
std::unique_ptr<PerIsolateData> isolate_data_;
std::unique_ptr<RunMicrotasksObserver> task_observer_;
std::unique_ptr<V8IsolateMemoryDumpProvider> isolate_memory_dump_provider_;
AccessMode access_mode_;
+ v8::StartupData startup_data_;
+ V8ContextMode v8_context_mode_;
DISALLOW_COPY_AND_ASSIGN(IsolateHolder);
};

Powered by Google App Engine
This is Rietveld 408576698