Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/proxy-wasm/null_plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,13 @@ class NullPlugin : public NullVmPlugin {
void onDelete(uint64_t context_id);

null_plugin::RootContext *getRoot(string_view root_id);
null_plugin::Context *getContext(uint64_t context_id);

void error(string_view message) { wasm_vm_->error(message); }

private:
null_plugin::Context *ensureContext(uint64_t context_id, uint64_t root_context_id);
null_plugin::RootContext *ensureRootContext(uint64_t context_id);
null_plugin::Context *getContext(uint64_t context_id);
null_plugin::RootContext *getRootContext(uint64_t context_id);
null_plugin::ContextBase *getContextBase(uint64_t context_id);

Expand Down
3 changes: 3 additions & 0 deletions include/proxy-wasm/wasm_api_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@
namespace proxy_wasm {
namespace null_plugin {
class RootContext;
class Context;
} // namespace null_plugin

null_plugin::RootContext *nullVmGetRoot(string_view root_id);
null_plugin::Context *nullVmGetContext(uint32_t context_id);

namespace null_plugin {

Expand Down Expand Up @@ -263,6 +265,7 @@ inline WasmResult proxy_call_foreign_function(const char *function_name, size_t
#undef WR

inline RootContext *getRoot(string_view root_id) { return nullVmGetRoot(root_id); }
inline Context *getContext(uint32_t context_id) { return nullVmGetContext(context_id); }

} // namespace null_plugin
} // namespace proxy_wasm
5 changes: 5 additions & 0 deletions src/null/null_plugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -459,4 +459,9 @@ null_plugin::RootContext *nullVmGetRoot(string_view root_id) {
return static_cast<NullPlugin *>(null_vm->plugin_.get())->getRoot(root_id);
}

null_plugin::Context *nullVmGetContext(uint32_t context_id) {
auto null_vm = static_cast<NullVm *>(current_context_->wasmVm());
return static_cast<NullPlugin *>(null_vm->plugin_.get())->getContext(context_id);
}

} // namespace proxy_wasm