refactor: use public node::CallbackScope where possible (#27001)
* refactor: use public node::CallbackScope where possible * Remove unused node_env() getter
This commit is contained in:
parent
21024011d7
commit
b266b5208a
3 changed files with 4 additions and 8 deletions
|
@ -89,7 +89,6 @@ class ElectronBrowserMainParts : public content::BrowserMainParts {
|
||||||
|
|
||||||
Browser* browser() { return browser_.get(); }
|
Browser* browser() { return browser_.get(); }
|
||||||
BrowserProcessImpl* browser_process() { return fake_browser_process_.get(); }
|
BrowserProcessImpl* browser_process() { return fake_browser_process_.get(); }
|
||||||
NodeEnvironment* node_env() { return node_env_.get(); }
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// content::BrowserMainParts:
|
// content::BrowserMainParts:
|
||||||
|
|
|
@ -29,11 +29,9 @@ void MicrotasksRunner::DidProcessTask(const base::PendingTask& pending_task) {
|
||||||
// up Node.js dealying its callbacks. To fix this, now we always lets Node.js
|
// up Node.js dealying its callbacks. To fix this, now we always lets Node.js
|
||||||
// handle the checkpoint in the browser process.
|
// handle the checkpoint in the browser process.
|
||||||
{
|
{
|
||||||
auto* node_env = electron::ElectronBrowserMainParts::Get()->node_env();
|
|
||||||
v8::HandleScope scope(isolate_);
|
v8::HandleScope scope(isolate_);
|
||||||
node::InternalCallbackScope microtasks_scope(
|
node::CallbackScope microtasks_scope(isolate_, v8::Object::New(isolate_),
|
||||||
node_env->env(), v8::Object::New(isolate_), {0, 0},
|
{0, 0});
|
||||||
node::InternalCallbackScope::kNoFlags);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -113,9 +113,8 @@ void ElectronBindings::OnCallNextTick(uv_async_t* handle) {
|
||||||
gin_helper::Locker locker(env->isolate());
|
gin_helper::Locker locker(env->isolate());
|
||||||
v8::Context::Scope context_scope(env->context());
|
v8::Context::Scope context_scope(env->context());
|
||||||
v8::HandleScope handle_scope(env->isolate());
|
v8::HandleScope handle_scope(env->isolate());
|
||||||
node::InternalCallbackScope scope(env, v8::Object::New(env->isolate()),
|
node::CallbackScope scope(env->isolate(), v8::Object::New(env->isolate()),
|
||||||
{0, 0},
|
{0, 0});
|
||||||
node::InternalCallbackScope::kNoFlags);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
self->pending_next_ticks_.clear();
|
self->pending_next_ticks_.clear();
|
||||||
|
|
Loading…
Reference in a new issue