Index: include/v8.h |
diff --git a/include/v8.h b/include/v8.h |
index b9d44d7df8b49053c4856ecfe913b1b9021eaa7b..f269b4cfc1f8f875ece68b531163bde010a4e7d3 100644 |
--- a/include/v8.h |
+++ b/include/v8.h |
@@ -5947,6 +5947,18 @@ typedef void (*FailedAccessCheckCallback)(Local<Object> target, |
*/ |
typedef bool (*AllowCodeGenerationFromStringsCallback)(Local<Context> context); |
+// --- WASM compilation callbacks --- |
+ |
+/** |
+ * Callback to check if a buffer source may be compiled to WASM, given |
+ * the compilation is attempted as a promise or not. |
+ */ |
+ |
+typedef bool (*AllowWasmCompileCallback)(Local<Value> source, bool as_promise); |
+ |
+typedef bool (*AllowWasmInstantiateCallback)(Local<WasmCompiledModule> module, |
+ Local<Value> ffi, bool as_promise); |
+ |
// --- Garbage Collection Callbacks --- |
/** |
@@ -7201,6 +7213,16 @@ class V8_EXPORT Isolate { |
AllowCodeGenerationFromStringsCallback callback); |
/** |
+ * Set the callback to invoke to check if wasm compilation from |
+ * the specified object is allowed. By default, wasm compilation |
+ * is allowed. |
+ * |
+ * Similar for instantiate. |
+ */ |
+ void SetAllowWasmCompileCallback(AllowWasmCompileCallback callback); |
+ void SetAllowWasmInstantiateCallback(AllowWasmInstantiateCallback callback); |
+ |
+ /** |
* Check if V8 is dead and therefore unusable. This is the case after |
* fatal errors such as out-of-memory situations. |
*/ |