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

Unified Diff: src/api.cc

Issue 2773063002: [wasm] Override mechanism for wasm js APIs (Closed)
Patch Set: Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index 3737da3aff2ac486b205dd0705b32cee3d26e2ec..9e13cba9e87165d88570fc5e521e1c504f3ad541 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -8738,6 +8738,18 @@ void Isolate::SetAllowWasmInstantiateCallback(
isolate->set_allow_wasm_instantiate_callback(callback);
}
+#define CALLBACK_SETTER(ExternalName, Type, InternalName) \
+ void Isolate::Set##ExternalName(Type callback) { \
+ i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); \
+ isolate->set_##InternalName(callback); \
+ }
+
+CALLBACK_SETTER(WasmModuleCallback, ExtensionCallback, wasm_module_callback)
+CALLBACK_SETTER(WasmCompileCallback, ExtensionCallback, wasm_compile_callback)
+CALLBACK_SETTER(WasmInstanceCallback, ExtensionCallback, wasm_instance_callback)
+CALLBACK_SETTER(WasmInstantiateCallback, ExtensionCallback,
+ wasm_instantiate_callback)
+
bool Isolate::IsDead() {
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
return isolate->IsDead();

Powered by Google App Engine
This is Rietveld 408576698