mirror of
https://github.com/electron/electron.git
synced 2026-05-02 03:00:22 -04:00
The `OnTraceBufferUsageAvailable` callback creates V8 handles via `Dictionary::CreateEmpty()` before `promise.Resolve()` enters its `SettleScope` (which provides a `HandleScope`). When the callback fires asynchronously from a Mojo response (i.e. when a trace session is active), there is no `HandleScope` on the stack, causing a fatal V8 error: "Cannot create a handle without a HandleScope". Add an explicit `v8::HandleScope` at the top of the callback, matching the pattern used by the other contentTracing APIs which resolve their promises through `SettleScope` or the static `ResolvePromise` helper. Made-with: Cursor Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Alexey Kozy <alexey@anysphere.co>