diff options
author | Anna Henningsen <anna@addaleax.net> | 2019-02-25 00:05:44 +0300 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2019-03-06 00:40:04 +0300 |
commit | 820ae61c12b12ceca23d96a30e1bbe8e601bc735 (patch) | |
tree | b6ce607bfea1261838b4d602babb06d08949a335 /src/inspector | |
parent | 753ebd742fc5da81c201dfc59fdc42cd80312ec3 (diff) |
src: forbid handle allocations from Platform tasks
Platform tasks should have their own handle scopes, rather than
leak into outer ones.
PR-URL: https://github.com/nodejs/node/pull/26376
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src/inspector')
-rw-r--r-- | src/inspector/main_thread_interface.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/inspector/main_thread_interface.cc b/src/inspector/main_thread_interface.cc index c58ea4cb410..14f90fbd9d3 100644 --- a/src/inspector/main_thread_interface.cc +++ b/src/inspector/main_thread_interface.cc @@ -268,6 +268,14 @@ void MainThreadInterface::DispatchMessages() { MessageQueue::value_type task; std::swap(dispatching_message_queue_.front(), task); dispatching_message_queue_.pop_front(); + + // TODO(addaleax): The V8 inspector code currently sometimes allocates + // handles that leak to the outside scope, rendering a HandleScope here + // necessary. This handle scope can be removed/turned into a + // SealHandleScope once/if + // https://chromium-review.googlesource.com/c/v8/v8/+/1484304 makes it + // into our copy of V8, maybe guarded with #ifdef DEBUG if we want. + v8::HandleScope handle_scope(isolate_); task->Call(this); } } while (had_messages); |