Index: include/v8.h |
diff --git a/include/v8.h b/include/v8.h |
index 9bce3ef628f71b008474143e978655f14246c69d..a92cca8123167d632d98f4f16d2e2ac3f3a4adba 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,23 @@ 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. It must be larger than 0. Use v8::Context::New for the |
peria
2016/12/07 10:11:08
According to tests, we can use 0 for this index, r
Yang
2016/12/07 10:13:34
Nice catch. The comment is outdated. Fixed.
|
+ * default (0-th) 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. |