Skip to content

Commit b266b52

Browse files
authored
refactor: use public node::CallbackScope where possible (electron#27001)
* refactor: use public node::CallbackScope where possible * Remove unused node_env() getter
1 parent 2102401 commit b266b52

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

shell/browser/electron_browser_main_parts.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ class ElectronBrowserMainParts : public content::BrowserMainParts {
8989

9090
Browser* browser() { return browser_.get(); }
9191
BrowserProcessImpl* browser_process() { return fake_browser_process_.get(); }
92-
NodeEnvironment* node_env() { return node_env_.get(); }
9392

9493
protected:
9594
// content::BrowserMainParts:

shell/browser/microtasks_runner.cc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,9 @@ void MicrotasksRunner::DidProcessTask(const base::PendingTask& pending_task) {
2929
// up Node.js dealying its callbacks. To fix this, now we always lets Node.js
3030
// handle the checkpoint in the browser process.
3131
{
32-
auto* node_env = electron::ElectronBrowserMainParts::Get()->node_env();
3332
v8::HandleScope scope(isolate_);
34-
node::InternalCallbackScope microtasks_scope(
35-
node_env->env(), v8::Object::New(isolate_), {0, 0},
36-
node::InternalCallbackScope::kNoFlags);
33+
node::CallbackScope microtasks_scope(isolate_, v8::Object::New(isolate_),
34+
{0, 0});
3735
}
3836
}
3937

shell/common/api/electron_bindings.cc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,8 @@ void ElectronBindings::OnCallNextTick(uv_async_t* handle) {
113113
gin_helper::Locker locker(env->isolate());
114114
v8::Context::Scope context_scope(env->context());
115115
v8::HandleScope handle_scope(env->isolate());
116-
node::InternalCallbackScope scope(env, v8::Object::New(env->isolate()),
117-
{0, 0},
118-
node::InternalCallbackScope::kNoFlags);
116+
node::CallbackScope scope(env->isolate(), v8::Object::New(env->isolate()),
117+
{0, 0});
119118
}
120119

121120
self->pending_next_ticks_.clear();

0 commit comments

Comments
 (0)