refactor: update gin_helper/function_template
(#41683)
* refactor: update gin_helper/function_template Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * fix: crash in Node.js Worker threads Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> --------- Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
parent
f585a4ef37
commit
83777ac83f
4 changed files with 271 additions and 114 deletions
|
@ -132,8 +132,9 @@ template <typename ReturnType, typename... ArgTypes>
|
|||
struct NativeFunctionInvoker<ReturnType(ArgTypes...)> {
|
||||
static void Go(base::RepeatingCallback<ReturnType(ArgTypes...)> val,
|
||||
gin::Arguments* args) {
|
||||
using Indices = typename IndicesGenerator<sizeof...(ArgTypes)>::type;
|
||||
Invoker<Indices, ArgTypes...> invoker(args, 0);
|
||||
using Indices = std::index_sequence_for<ArgTypes...>;
|
||||
Invoker<Indices, ArgTypes...> invoker(args,
|
||||
{.holder_is_first_argument = false});
|
||||
if (invoker.IsOK())
|
||||
invoker.DispatchToCallback(val);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue