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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/api.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** \mainpage V8 API Reference Guide 5 /** \mainpage V8 API Reference Guide
6 * 6 *
7 * V8 is Google's open source JavaScript engine. 7 * V8 is Google's open source JavaScript engine.
8 * 8 *
9 * This set of documents provides reference material generated from the 9 * This set of documents provides reference material generated from the
10 * V8 header file, include/v8.h. 10 * V8 header file, include/v8.h.
(...skipping 7542 matching lines...) Expand 10 before | Expand all | Expand 10 after
7553 StartupData* existing_blob = nullptr); 7553 StartupData* existing_blob = nullptr);
7554 7554
7555 ~SnapshotCreator(); 7555 ~SnapshotCreator();
7556 7556
7557 /** 7557 /**
7558 * \returns the isolate prepared by the snapshot creator. 7558 * \returns the isolate prepared by the snapshot creator.
7559 */ 7559 */
7560 Isolate* GetIsolate(); 7560 Isolate* GetIsolate();
7561 7561
7562 /** 7562 /**
7563 * Add a context to be included in the snapshot blob. 7563 * Set the default context to be included in the snapshot blob.
7564 * The snapshot will not contain the global proxy, and we expect one or a
7565 * global object template to create one, to be provided upon deserialization.
7566 */
7567 void SetDefaultContext(Local<Context> context);
7568
7569 /**
7570 * Add additional context to be included in the snapshot blob.
7571 * The snapshot will include the global proxy.
7572 *
7564 * \returns the index of the context in the snapshot blob. 7573 * \returns the index of the context in the snapshot blob.
7565 */ 7574 */
7566 size_t AddContext(Local<Context> context); 7575 size_t AddContext(Local<Context> context);
7567 7576
7568 /** 7577 /**
7569 * Add a template to be included in the snapshot blob. 7578 * Add a template to be included in the snapshot blob.
7570 * \returns the index of the template in the snapshot blob. 7579 * \returns the index of the template in the snapshot blob.
7571 */ 7580 */
7572 size_t AddTemplate(Local<Template> template_obj); 7581 size_t AddTemplate(Local<Template> template_obj);
7573 7582
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
7877 * the newly created context. This global object must have been 7886 * the newly created context. This global object must have been
7878 * created by a previous call to Context::New with the same global 7887 * created by a previous call to Context::New with the same global
7879 * template. The state of the global object will be completely reset 7888 * template. The state of the global object will be completely reset
7880 * and only object identify will remain. 7889 * and only object identify will remain.
7881 */ 7890 */
7882 static Local<Context> New( 7891 static Local<Context> New(
7883 Isolate* isolate, ExtensionConfiguration* extensions = NULL, 7892 Isolate* isolate, ExtensionConfiguration* extensions = NULL,
7884 MaybeLocal<ObjectTemplate> global_template = MaybeLocal<ObjectTemplate>(), 7893 MaybeLocal<ObjectTemplate> global_template = MaybeLocal<ObjectTemplate>(),
7885 MaybeLocal<Value> global_object = MaybeLocal<Value>()); 7894 MaybeLocal<Value> global_object = MaybeLocal<Value>());
7886 7895
7887 static MaybeLocal<Context> FromSnapshot(
7888 Isolate* isolate, size_t context_snapshot_index,
7889 ExtensionConfiguration* extensions = nullptr,
7890 MaybeLocal<ObjectTemplate> global_template = MaybeLocal<ObjectTemplate>(),
7891 MaybeLocal<Value> global_object = MaybeLocal<Value>());
7892
7893 /** 7896 /**
7897 * Create a new context from a (non-default) context snapshot. There
7898 * is no way to provide a global template or global proxy since the
7899 * context snapshot already contains a global proxy.
7900 *
7901 * \param isolate See v8::Context::New.
7902 *
7903 * \param context_snapshot_index The index of the context snapshot to
7904 * deserialize from. Use v8::Context::New for the default snapshot.
7905 *
7906 * \param extensions See v8::Context::New.
7907 */
7908
7909 static MaybeLocal<Context> FromSnapshot(
7910 Isolate* isolate, size_t context_snapshot_index,
7911 ExtensionConfiguration* extensions = nullptr);
7912
7913 /**
7894 * Returns an global object that isn't backed by an actual context. 7914 * Returns an global object that isn't backed by an actual context.
7895 * 7915 *
7896 * The global template needs to have access checks with handlers installed. 7916 * The global template needs to have access checks with handlers installed.
7897 * If an existing global object is passed in, the global object is detached 7917 * If an existing global object is passed in, the global object is detached
7898 * from its context. 7918 * from its context.
7899 * 7919 *
7900 * Note that this is different from a detached context where all accesses to 7920 * Note that this is different from a detached context where all accesses to
7901 * the global proxy will fail. Instead, the access check handlers are invoked. 7921 * the global proxy will fail. Instead, the access check handlers are invoked.
7902 * 7922 *
7903 * It is also not possible to detach an object returned by this method. 7923 * It is also not possible to detach an object returned by this method.
(...skipping 1743 matching lines...) Expand 10 before | Expand all | Expand 10 after
9647 */ 9667 */
9648 9668
9649 9669
9650 } // namespace v8 9670 } // namespace v8
9651 9671
9652 9672
9653 #undef TYPE_CHECK 9673 #undef TYPE_CHECK
9654 9674
9655 9675
9656 #endif // INCLUDE_V8_H_ 9676 #endif // INCLUDE_V8_H_
OLDNEW
« 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