alexkozy

#50556: fix: add missing HandleScope in contentTracing.getTraceBufferUsage()

Merged
Created: Mar 27, 2026, 7:35:49 PM
Merged: Mar 30, 2026, 8:21:44 PM
7 comments
Target: main

Description of Change

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.

Checklist

Release Notes

Notes: Fixed a crash when calling contentTracing.getTraceBufferUsage() while a trace session is active.

Backports

39-x-y
Merged
PR Number
#50595
Merged At
Mar 31, 2026, 4:37:28 AM
Released In
Not yet
Release Date
Not yet
40-x-y
Merged
PR Number
#50593
Merged At
Mar 31, 2026, 4:12:14 AM
Released In
Not yet
Release Date
Not yet
41-x-y
Merged
PR Number
#50594
Merged At
Mar 31, 2026, 3:15:14 AM
Released In
v41.1.1
Release Date
Mar 31, 2026, 12:32:06 PM
42-x-y
Merged
PR Number
#50592
Merged At
Mar 31, 2026, 5:15:19 AM
Released In
Not yet
Release Date
Not yet

Semver Impact

Major
Breaking changes
Minor
New features
Patch
Bug fixes
None
Docs, tests, etc.

Semantic Versioning helps users understand the impact of updates:

  • Major (X.y.z): Breaking changes that may require code modifications
  • Minor (x.Y.z): New features that maintain backward compatibility
  • Patch (x.y.Z): Bug fixes that don't change the API
  • None: Changes that don't affect using facing parts of Electron