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:
Shelley Vohr 2020-12-15 11:39:25 -08:00 committed by GitHub
parent 21024011d7
commit b266b5208a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 8 deletions

View file

@ -89,7 +89,6 @@ class ElectronBrowserMainParts : public content::BrowserMainParts {
Browser* browser() { return browser_.get(); }
BrowserProcessImpl* browser_process() { return fake_browser_process_.get(); }
NodeEnvironment* node_env() { return node_env_.get(); }
protected:
// content::BrowserMainParts:

View file

@ -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
// handle the checkpoint in the browser process.
{
auto* node_env = electron::ElectronBrowserMainParts::Get()->node_env();
v8::HandleScope scope(isolate_);
node::InternalCallbackScope microtasks_scope(
node_env->env(), v8::Object::New(isolate_), {0, 0},
node::InternalCallbackScope::kNoFlags);
node::CallbackScope microtasks_scope(isolate_, v8::Object::New(isolate_),
{0, 0});
}
}

View file

@ -113,9 +113,8 @@ void ElectronBindings::OnCallNextTick(uv_async_t* handle) {
gin_helper::Locker locker(env->isolate());
v8::Context::Scope context_scope(env->context());
v8::HandleScope handle_scope(env->isolate());
node::InternalCallbackScope scope(env, v8::Object::New(env->isolate()),
{0, 0},
node::InternalCallbackScope::kNoFlags);
node::CallbackScope scope(env->isolate(), v8::Object::New(env->isolate()),
{0, 0});
}
self->pending_next_ticks_.clear();