@@ -54,34 +54,18 @@ class WasmBase : public std::enable_shared_from_this<WasmBase> {
5454 WasmBase (const std::shared_ptr<WasmHandleBase> &base_wasm_handle, const WasmVmFactory &factory);
5555 virtual ~WasmBase ();
5656
57- #ifdef PROXY_WASM_CPP_HOST_MORE_VIRTUAL_METHODS
5857 virtual bool load (const std::string &code, bool allow_precompiled = false );
5958 virtual bool initialize ();
6059 virtual void startVm (ContextBase *root_context);
6160 virtual bool configure (ContextBase *root_context, std::shared_ptr<PluginBase> plugin);
62- #else
63- bool load (const std::string &code, bool allow_precompiled = false );
64- bool initialize ();
65- void startVm (ContextBase *root_context);
66- bool configure (ContextBase *root_context, std::shared_ptr<PluginBase> plugin);
67- #endif
6861 // Returns the root ContextBase or nullptr if onStart returns false.
69- #ifdef PROXY_WASM_CPP_HOST_MORE_VIRTUAL_METHODS
7062 virtual ContextBase *start (const std::shared_ptr<PluginBase> &plugin);
71- #else
72- ContextBase *start (const std::shared_ptr<PluginBase> &plugin);
73- #endif
7463
7564 std::string_view vm_id () const { return vm_id_; }
7665 std::string_view vm_key () const { return vm_key_; }
7766 WasmVm *wasm_vm () const { return wasm_vm_.get (); }
78- #ifdef PROXY_WASM_CPP_HOST_MORE_VIRTUAL_METHODS
7967 virtual ContextBase *vm_context () const { return vm_context_.get (); }
8068 virtual ContextBase *getRootContext (const std::shared_ptr<PluginBase> &plugin, bool allow_closed);
81- #else
82- ContextBase *vm_context () const { return vm_context_.get (); }
83- ContextBase *getRootContext (const std::shared_ptr<PluginBase> &plugin, bool allow_closed);
84- #endif
8569 ContextBase *getContext (uint32_t id) {
8670 auto it = contexts_.find (id);
8771 if (it != contexts_.end ())
@@ -337,23 +321,14 @@ using WasmHandleCloneFactory =
337321class WasmHandleBase : public std ::enable_shared_from_this<WasmHandleBase> {
338322public:
339323 explicit WasmHandleBase (std::shared_ptr<WasmBase> wasm_base) : wasm_base_(wasm_base) {}
340- #ifdef PROXY_WASM_CPP_HOST_MORE_VIRTUAL_METHODS
341324 virtual ~WasmHandleBase () {
342- #else
343- ~WasmHandleBase () {
344- #endif
345325 if (wasm_base_) {
346326 wasm_base_->startShutdown ();
347327 }
348328 }
349329
350- #ifdef PROXY_WASM_CPP_HOST_MORE_VIRTUAL_METHODS
351330 virtual bool canary (const std::shared_ptr<PluginBase> &plugin,
352331 const WasmHandleCloneFactory &clone_factory);
353- #else
354- bool canary (const std::shared_ptr<PluginBase> &plugin,
355- const WasmHandleCloneFactory &clone_factory);
356- #endif
357332
358333 void kill () { wasm_base_ = nullptr ; }
359334
@@ -381,11 +356,7 @@ class PluginHandleBase : public std::enable_shared_from_this<PluginHandleBase> {
381356 explicit PluginHandleBase (std::shared_ptr<WasmHandleBase> wasm_handle,
382357 std::shared_ptr<PluginBase> plugin)
383358 : plugin_(plugin), wasm_handle_(wasm_handle) {}
384- #ifdef PROXY_WASM_CPP_HOST_MORE_VIRTUAL_METHODS
385359 virtual ~PluginHandleBase () {
386- #else
387- ~PluginHandleBase () {
388- #endif
389360 if (wasm_handle_) {
390361 wasm_handle_->wasm ()->startShutdown (plugin_->key ());
391362 }
0 commit comments