@@ -314,6 +314,10 @@ class WasmBase : public std::enable_shared_from_this<WasmBase> {
314
314
std::shared_ptr<VmIdHandle> vm_id_handle_;
315
315
};
316
316
317
+ using WasmHandleFactory = std::function<std::shared_ptr<WasmHandleBase>(std::string_view vm_id)>;
318
+ using WasmHandleCloneFactory =
319
+ std::function<std::shared_ptr<WasmHandleBase>(std::shared_ptr<WasmHandleBase> wasm)>;
320
+
317
321
// Handle which enables shutdown operations to run post deletion (e.g. post listener drain).
318
322
class WasmHandleBase : public std ::enable_shared_from_this<WasmHandleBase> {
319
323
public:
@@ -324,6 +328,8 @@ class WasmHandleBase : public std::enable_shared_from_this<WasmHandleBase> {
324
328
}
325
329
}
326
330
331
+ bool canary (const std::shared_ptr<PluginBase> &plugin, const WasmHandleCloneFactory &clone_factory);
332
+
327
333
void kill () { wasm_base_ = nullptr ; }
328
334
329
335
std::shared_ptr<WasmBase> &wasm () { return wasm_base_; }
@@ -335,10 +341,6 @@ class WasmHandleBase : public std::enable_shared_from_this<WasmHandleBase> {
335
341
std::string makeVmKey (std::string_view vm_id, std::string_view configuration,
336
342
std::string_view code);
337
343
338
- using WasmHandleFactory = std::function<std::shared_ptr<WasmHandleBase>(std::string_view vm_id)>;
339
- using WasmHandleCloneFactory =
340
- std::function<std::shared_ptr<WasmHandleBase>(std::shared_ptr<WasmHandleBase> wasm)>;
341
-
342
344
// Returns nullptr on failure (i.e. initialization of the VM fails).
343
345
std::shared_ptr<WasmHandleBase> createWasm (const std::string &vm_key, const std::string &code,
344
346
const std::shared_ptr<PluginBase> &plugin,
0 commit comments