@@ -54,34 +54,18 @@ class WasmBase : public std::enable_shared_from_this<WasmBase> {
54
54
WasmBase (const std::shared_ptr<WasmHandleBase> &base_wasm_handle, const WasmVmFactory &factory);
55
55
virtual ~WasmBase ();
56
56
57
- #ifdef PROXY_WASM_CPP_HOST_MORE_VIRTUAL_METHODS
58
57
virtual bool load (const std::string &code, bool allow_precompiled = false );
59
58
virtual bool initialize ();
60
59
virtual void startVm (ContextBase *root_context);
61
60
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
68
61
// Returns the root ContextBase or nullptr if onStart returns false.
69
- #ifdef PROXY_WASM_CPP_HOST_MORE_VIRTUAL_METHODS
70
62
virtual ContextBase *start (const std::shared_ptr<PluginBase> &plugin);
71
- #else
72
- ContextBase *start (const std::shared_ptr<PluginBase> &plugin);
73
- #endif
74
63
75
64
std::string_view vm_id () const { return vm_id_; }
76
65
std::string_view vm_key () const { return vm_key_; }
77
66
WasmVm *wasm_vm () const { return wasm_vm_.get (); }
78
- #ifdef PROXY_WASM_CPP_HOST_MORE_VIRTUAL_METHODS
79
67
virtual ContextBase *vm_context () const { return vm_context_.get (); }
80
68
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
85
69
ContextBase *getContext (uint32_t id) {
86
70
auto it = contexts_.find (id);
87
71
if (it != contexts_.end ())
@@ -337,23 +321,14 @@ using WasmHandleCloneFactory =
337
321
class WasmHandleBase : public std ::enable_shared_from_this<WasmHandleBase> {
338
322
public:
339
323
explicit WasmHandleBase (std::shared_ptr<WasmBase> wasm_base) : wasm_base_(wasm_base) {}
340
- #ifdef PROXY_WASM_CPP_HOST_MORE_VIRTUAL_METHODS
341
324
virtual ~WasmHandleBase () {
342
- #else
343
- ~WasmHandleBase () {
344
- #endif
345
325
if (wasm_base_) {
346
326
wasm_base_->startShutdown ();
347
327
}
348
328
}
349
329
350
- #ifdef PROXY_WASM_CPP_HOST_MORE_VIRTUAL_METHODS
351
330
virtual bool canary (const std::shared_ptr<PluginBase> &plugin,
352
331
const WasmHandleCloneFactory &clone_factory);
353
- #else
354
- bool canary (const std::shared_ptr<PluginBase> &plugin,
355
- const WasmHandleCloneFactory &clone_factory);
356
- #endif
357
332
358
333
void kill () { wasm_base_ = nullptr ; }
359
334
@@ -381,11 +356,7 @@ class PluginHandleBase : public std::enable_shared_from_this<PluginHandleBase> {
381
356
explicit PluginHandleBase (std::shared_ptr<WasmHandleBase> wasm_handle,
382
357
std::shared_ptr<PluginBase> plugin)
383
358
: plugin_(plugin), wasm_handle_(wasm_handle) {}
384
- #ifdef PROXY_WASM_CPP_HOST_MORE_VIRTUAL_METHODS
385
359
virtual ~PluginHandleBase () {
386
- #else
387
- ~PluginHandleBase () {
388
- #endif
389
360
if (wasm_handle_) {
390
361
wasm_handle_->wasm ()->startShutdown (plugin_->key ());
391
362
}
0 commit comments