Handle v8::MicrotasksScope in the main process
This commit is contained in:
parent
5826a8f9a9
commit
ee28f4fc32
7 changed files with 27 additions and 25 deletions
|
@ -48,11 +48,8 @@ struct V8FunctionInvoker<v8::Local<v8::Value>(ArgTypes...)> {
|
|||
v8::EscapableHandleScope handle_scope(isolate);
|
||||
if (!function.IsAlive())
|
||||
return v8::Null(isolate);
|
||||
std::unique_ptr<v8::MicrotasksScope> script_scope(
|
||||
Locker::IsBrowserProcess() ?
|
||||
nullptr :
|
||||
new v8::MicrotasksScope(isolate,
|
||||
v8::MicrotasksScope::kRunMicrotasks));
|
||||
v8::MicrotasksScope script_scope(isolate,
|
||||
v8::MicrotasksScope::kRunMicrotasks);
|
||||
v8::Local<v8::Function> holder = function.NewHandle(isolate);
|
||||
v8::Local<v8::Context> context = holder->CreationContext();
|
||||
v8::Context::Scope context_scope(context);
|
||||
|
@ -71,11 +68,8 @@ struct V8FunctionInvoker<void(ArgTypes...)> {
|
|||
v8::HandleScope handle_scope(isolate);
|
||||
if (!function.IsAlive())
|
||||
return;
|
||||
std::unique_ptr<v8::MicrotasksScope> script_scope(
|
||||
Locker::IsBrowserProcess() ?
|
||||
nullptr :
|
||||
new v8::MicrotasksScope(isolate,
|
||||
v8::MicrotasksScope::kRunMicrotasks));
|
||||
v8::MicrotasksScope script_scope(isolate,
|
||||
v8::MicrotasksScope::kRunMicrotasks);
|
||||
v8::Local<v8::Function> holder = function.NewHandle(isolate);
|
||||
v8::Local<v8::Context> context = holder->CreationContext();
|
||||
v8::Context::Scope context_scope(context);
|
||||
|
@ -94,11 +88,8 @@ struct V8FunctionInvoker<ReturnType(ArgTypes...)> {
|
|||
ReturnType ret = ReturnType();
|
||||
if (!function.IsAlive())
|
||||
return ret;
|
||||
std::unique_ptr<v8::MicrotasksScope> script_scope(
|
||||
Locker::IsBrowserProcess() ?
|
||||
nullptr :
|
||||
new v8::MicrotasksScope(isolate,
|
||||
v8::MicrotasksScope::kRunMicrotasks));
|
||||
v8::MicrotasksScope script_scope(isolate,
|
||||
v8::MicrotasksScope::kRunMicrotasks);
|
||||
v8::Local<v8::Function> holder = function.NewHandle(isolate);
|
||||
v8::Local<v8::Context> context = holder->CreationContext();
|
||||
v8::Context::Scope context_scope(context);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue