fix: gin_helper::MicrotasksScope instantiation (#43210)

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
This commit is contained in:
trop[bot] 2024-08-05 15:17:15 -05:00 committed by GitHub
parent ccd372457a
commit 10a8c258cb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 55 additions and 44 deletions

View file

@ -262,9 +262,10 @@ class Invoker<std::index_sequence<indices...>, ArgTypes...>
template <typename ReturnType>
void DispatchToCallback(
base::RepeatingCallback<ReturnType(ArgTypes...)> callback) {
gin_helper::MicrotasksScope microtasks_scope(
gin_helper::MicrotasksScope microtasks_scope{
args_->isolate(),
args_->GetHolderCreationContext()->GetMicrotaskQueue(), true);
args_->GetHolderCreationContext()->GetMicrotaskQueue(), true,
v8::MicrotasksScope::kRunMicrotasks};
args_->Return(
callback.Run(std::move(ArgumentHolder<indices, ArgTypes>::value)...));
}
@ -273,9 +274,10 @@ class Invoker<std::index_sequence<indices...>, ArgTypes...>
// expression to foo. As a result, we must specialize the case of Callbacks
// that have the void return type.
void DispatchToCallback(base::RepeatingCallback<void(ArgTypes...)> callback) {
gin_helper::MicrotasksScope microtasks_scope(
gin_helper::MicrotasksScope microtasks_scope{
args_->isolate(),
args_->GetHolderCreationContext()->GetMicrotaskQueue(), true);
args_->GetHolderCreationContext()->GetMicrotaskQueue(), true,
v8::MicrotasksScope::kRunMicrotasks};
callback.Run(std::move(ArgumentHolder<indices, ArgTypes>::value)...);
}