From e872f1d6c36d9eb2cf843149bf27598bffe291b7 Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Sat, 20 Aug 2022 18:27:14 +0200 Subject: [PATCH] Do not use deprecated Callback::Call overload in Node bindings (#6318) --- CHANGELOG.md | 1 + src/nodejs/node_osrm.cpp | 11 ++++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fbf414455d9..d9ed1703ec7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - FIXED: Use Boost.Beast to parse HTTP request. [#6294](https://github.com/Project-OSRM/osrm-backend/pull/6294) - FIXED: Fix inefficient osrm-routed connection handling [#6113](https://github.com/Project-OSRM/osrm-backend/pull/6113) - Misc: + - CHANGED: Do not use deprecated Callback::Call overload in Node bindings. [#6318](https://github.com/Project-OSRM/osrm-backend/pull/6318) - FIXED: Fix distance calculation consistency. [#6315](https://github.com/Project-OSRM/osrm-backend/pull/6315) - FIXED: Fix performance issue after migration to sol2 3.3.0. [#6304](https://github.com/Project-OSRM/osrm-backend/pull/6304) - CHANGED: Pass osm_node_ids by reference in osrm::updater::Updater class. [#6298](https://github.com/Project-OSRM/osrm-backend/pull/6298) diff --git a/src/nodejs/node_osrm.cpp b/src/nodejs/node_osrm.cpp index ebd3b3fbf81..5c8c486a579 100644 --- a/src/nodejs/node_osrm.cpp +++ b/src/nodejs/node_osrm.cpp @@ -148,7 +148,7 @@ inline void async(const Nan::FunctionCallbackInfo &info, ServiceMemFn service, Nan::Callback *callback, PluginParameters pluginParams_) - : Base(callback), osrm{std::move(osrm_)}, service{std::move(service)}, + : Base(callback, "osrm:async"), osrm{std::move(osrm_)}, service{std::move(service)}, params{std::move(params_)}, pluginParams{std::move(pluginParams_)} { } @@ -184,7 +184,7 @@ inline void async(const Nan::FunctionCallbackInfo &info, const constexpr auto argc = 2u; v8::Local argv[argc] = {Nan::Null(), render(result)}; - callback->Call(argc, argv); + callback->Call(argc, argv, async_resource); } // Keeps the OSRM object alive even after shutdown until we're done with callback @@ -230,8 +230,9 @@ inline void asyncForTiles(const Nan::FunctionCallbackInfo &info, ServiceMemFn service, Nan::Callback *callback, PluginParameters pluginParams_) - : Base(callback), osrm{std::move(osrm_)}, service{std::move(service)}, - params{std::move(params_)}, pluginParams{std::move(pluginParams_)} + : Base(callback, "osrm:asyncForTiles"), osrm{std::move(osrm_)}, + service{std::move(service)}, params{std::move(params_)}, pluginParams{ + std::move(pluginParams_)} { } @@ -256,7 +257,7 @@ inline void asyncForTiles(const Nan::FunctionCallbackInfo &info, auto str_result = result.get(); v8::Local argv[argc] = {Nan::Null(), render(str_result)}; - callback->Call(argc, argv); + callback->Call(argc, argv, async_resource); } // Keeps the OSRM object alive even after shutdown until we're done with callback