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

Unified Diff: include/v8.h

Issue 2557743003: [serializer] include global proxy in additional context snapshots. (Closed)
Patch Set: fix comment Created 4 years 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 | src/api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/v8.h
diff --git a/include/v8.h b/include/v8.h
index 9bce3ef628f71b008474143e978655f14246c69d..6d7f5cab13098a1974dd3abf5c507f7f504888bc 100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -7560,7 +7560,16 @@ class V8_EXPORT SnapshotCreator {
Isolate* GetIsolate();
/**
- * Add a context to be included in the snapshot blob.
+ * Set the default context to be included in the snapshot blob.
+ * The snapshot will not contain the global proxy, and we expect one or a
+ * global object template to create one, to be provided upon deserialization.
+ */
+ void SetDefaultContext(Local<Context> context);
+
+ /**
+ * Add additional context to be included in the snapshot blob.
+ * The snapshot will include the global proxy.
+ *
* \returns the index of the context in the snapshot blob.
*/
size_t AddContext(Local<Context> context);
@@ -7884,11 +7893,22 @@ class V8_EXPORT Context {
MaybeLocal<ObjectTemplate> global_template = MaybeLocal<ObjectTemplate>(),
MaybeLocal<Value> global_object = MaybeLocal<Value>());
+ /**
+ * Create a new context from a (non-default) context snapshot. There
+ * is no way to provide a global template or global proxy since the
+ * context snapshot already contains a global proxy.
+ *
+ * \param isolate See v8::Context::New.
+ *
+ * \param context_snapshot_index The index of the context snapshot to
+ * deserialize from. Use v8::Context::New for the default snapshot.
+ *
+ * \param extensions See v8::Context::New.
+ */
+
static MaybeLocal<Context> FromSnapshot(
Isolate* isolate, size_t context_snapshot_index,
- ExtensionConfiguration* extensions = nullptr,
- MaybeLocal<ObjectTemplate> global_template = MaybeLocal<ObjectTemplate>(),
- MaybeLocal<Value> global_object = MaybeLocal<Value>());
+ ExtensionConfiguration* extensions = nullptr);
/**
* Returns an global object that isn't backed by an actual context.
« no previous file with comments | « no previous file | src/api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698