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

Side by Side Diff: include/v8.h

Issue 2709613008: Merged: [wasm] Embedder can control what buffers wasm compilation works on. (Closed)
Patch Set: Created 3 years, 10 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/api.cc » ('j') | src/wasm/wasm-js.cc » ('J')
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 5904 matching lines...) Expand 10 before | Expand all | Expand 10 after
5915 Local<Value> data); 5915 Local<Value> data);
5916 5916
5917 // --- AllowCodeGenerationFromStrings callbacks --- 5917 // --- AllowCodeGenerationFromStrings callbacks ---
5918 5918
5919 /** 5919 /**
5920 * Callback to check if code generation from strings is allowed. See 5920 * Callback to check if code generation from strings is allowed. See
5921 * Context::AllowCodeGenerationFromStrings. 5921 * Context::AllowCodeGenerationFromStrings.
5922 */ 5922 */
5923 typedef bool (*AllowCodeGenerationFromStringsCallback)(Local<Context> context); 5923 typedef bool (*AllowCodeGenerationFromStringsCallback)(Local<Context> context);
5924 5924
5925 // --- WASM compilation callbacks ---
5926
5927 /**
5928 * Callback to check if a buffer source may be compiled to WASM, given
5929 * the compilation is attempted as a promise or not.
5930 */
5931
5932 typedef bool (*AllowWasmCompileCallback)(Isolate* isolate, Local<Value> source,
5933 bool as_promise);
5934
5935 typedef bool (*AllowWasmInstantiateCallback)(Isolate* isolate,
5936 Local<Value> module_or_bytes,
5937 MaybeLocal<Value> ffi,
5938 bool as_promise);
5939
5925 // --- Garbage Collection Callbacks --- 5940 // --- Garbage Collection Callbacks ---
5926 5941
5927 /** 5942 /**
5928 * Applications can register callback functions which will be called before and 5943 * Applications can register callback functions which will be called before and
5929 * after certain garbage collection operations. Allocations are not allowed in 5944 * after certain garbage collection operations. Allocations are not allowed in
5930 * the callback functions, you therefore cannot manipulate objects (set or 5945 * the callback functions, you therefore cannot manipulate objects (set or
5931 * delete properties for example) since it is possible such operations will 5946 * delete properties for example) since it is possible such operations will
5932 * result in the allocation of objects. 5947 * result in the allocation of objects.
5933 */ 5948 */
5934 enum GCType { 5949 enum GCType {
(...skipping 1227 matching lines...) Expand 10 before | Expand all | Expand 10 after
7162 void SetOOMErrorHandler(OOMErrorCallback that); 7177 void SetOOMErrorHandler(OOMErrorCallback that);
7163 7178
7164 /** 7179 /**
7165 * Set the callback to invoke to check if code generation from 7180 * Set the callback to invoke to check if code generation from
7166 * strings should be allowed. 7181 * strings should be allowed.
7167 */ 7182 */
7168 void SetAllowCodeGenerationFromStringsCallback( 7183 void SetAllowCodeGenerationFromStringsCallback(
7169 AllowCodeGenerationFromStringsCallback callback); 7184 AllowCodeGenerationFromStringsCallback callback);
7170 7185
7171 /** 7186 /**
7187 * Set the callback to invoke to check if wasm compilation from
7188 * the specified object is allowed. By default, wasm compilation
7189 * is allowed.
7190 *
7191 * Similar for instantiate.
7192 */
7193 void SetAllowWasmCompileCallback(AllowWasmCompileCallback callback);
7194 void SetAllowWasmInstantiateCallback(AllowWasmInstantiateCallback callback);
7195
7196 /**
7172 * Check if V8 is dead and therefore unusable. This is the case after 7197 * Check if V8 is dead and therefore unusable. This is the case after
7173 * fatal errors such as out-of-memory situations. 7198 * fatal errors such as out-of-memory situations.
7174 */ 7199 */
7175 bool IsDead(); 7200 bool IsDead();
7176 7201
7177 /** 7202 /**
7178 * Adds a message listener (errors only). 7203 * Adds a message listener (errors only).
7179 * 7204 *
7180 * The same message listener can be added more than once and in that 7205 * The same message listener can be added more than once and in that
7181 * case it will be called more than once for each message. 7206 * case it will be called more than once for each message.
(...skipping 2650 matching lines...) Expand 10 before | Expand all | Expand 10 after
9832 */ 9857 */
9833 9858
9834 9859
9835 } // namespace v8 9860 } // namespace v8
9836 9861
9837 9862
9838 #undef TYPE_CHECK 9863 #undef TYPE_CHECK
9839 9864
9840 9865
9841 #endif // INCLUDE_V8_H_ 9866 #endif // INCLUDE_V8_H_
OLDNEW
« no previous file with comments | « no previous file | src/api.cc » ('j') | src/wasm/wasm-js.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698