mirror of
https://github.com/electron/electron.git
synced 2026-05-02 03:00:22 -04:00
fix: bind offscreen paint callback to child WebContents Previously, MaybeOverrideCreateParamsForNewWindow bound the OffScreenWebContentsView's paint callback to the parent WebContents using base::Unretained(this). This was both unsafe (dangling pointer risk if the parent is destroyed before the child) and semantically incorrect — paint events belong to the child window, not the opener. Replace the callback in MaybeOverrideCreateParamsForNewWindow with base::DoNothing(), then rebind it to the child WebContents in AddNewContents via a new SetCallback method on OffScreenWebContentsView. Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>