cucbin

#51570: chore: use promise's context for memory dump callback.

Merged
Created: May 8, 2026, 11:15:21 PM
Merged: May 11, 2026, 12:34:04 PM
1 comments
Target: main

Description of Change

When I was doing some crash analysis, I found that the following optimizations can be made to this code.

Remove the redundant v8::Global<v8::Context> plumbing from the process memory info callbacks.

gin_helper::Promise already retains the V8 context it was created with, so DidReceiveMemoryDump can use promise.GetContext() directly when settling the promise. This simplifies both the browser process and webContents memory info paths without changing behavior.

Checklist

Release Notes

Notes: none

Backports

No Backports Requested

This pull request doesn't have any backports requested or created for older release branches.

What are backports?

Backports are copies of changes made to the main branch that are applied to older release branches. They ensure that bug fixes and important changes are available in maintained older versions of Electron.

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