Repository navigation
refactor: allocate api::Debugger on cpp heap - #48266
Merged
Merged
Conversation
ckerr
marked this pull request as draft
September 5, 2025 18:30
ckerr
force-pushed
the
refactor/cppgc-api-debugger
branch
from
September 5, 2025 19:31
ab85ce4 to
32861cf
Compare
deepak1556
reviewed
Sep 6, 2025
Member
Prefinalizer have runtime cost to them, so we should avoid unless there is no other option. In this case, the debugger is created and held for the lifetime of |
ckerr
force-pushed
the
refactor/cppgc-api-debugger
branch
from
September 8, 2025 15:53
32861cf to
77fc69c
Compare
needed for cppgc::MakeGarbageCollected() This is what upstream does, e.g. https://chromium-review.googlesource.com/c/chromium/src/+/6722236
mark Debugger ctor as explicit
ckerr
force-pushed
the
refactor/cppgc-api-debugger
branch
from
September 8, 2025 21:48
c6ad394 to
a300f3a
Compare
ckerr
marked this pull request as ready for review
September 10, 2025 19:23
deepak1556
approved these changes
Sep 10, 2025
codebytere
approved these changes
Sep 11, 2025
jkleinsc
approved these changes
Sep 11, 2025
|
No Release Notes |
2 tasks done
kigh-ota
pushed a commit
to kigh-ota/electron
that referenced
this pull request
Sep 30, 2025
* refactor: remove unused isolate arg from Debugger ctor * refactor: make Debugger ctor, dtor public needed for cppgc::MakeGarbageCollected() This is what upstream does, e.g. https://chromium-review.googlesource.com/c/chromium/src/+/6722236 * fixup! refactor: remove unused isolate arg from Debugger ctor mark Debugger ctor as explicit * refactor: in EventEmitterMixin, handle both old and new WrapperInfo types * refactor: make electron::api::Debugger inherit from gin::Wrappable * refactor: add api::Debugger::GetTypeName() * refactor: add api::Debugger::GetClassName()
nilayarya
pushed a commit
to nilayarya/electron
that referenced
this pull request
Nov 21, 2025
* refactor: remove unused isolate arg from Debugger ctor * refactor: make Debugger ctor, dtor public needed for cppgc::MakeGarbageCollected() This is what upstream does, e.g. https://chromium-review.googlesource.com/c/chromium/src/+/6722236 * fixup! refactor: remove unused isolate arg from Debugger ctor mark Debugger ctor as explicit * refactor: in EventEmitterMixin, handle both old and new WrapperInfo types * refactor: make electron::api::Debugger inherit from gin::Wrappable * refactor: add api::Debugger::GetTypeName() * refactor: add api::Debugger::GetClassName()
nilayarya
added a commit
to nilayarya/electron
that referenced
this pull request
Nov 21, 2025
* refactor: remove unused isolate arg from Debugger ctor * refactor: make Debugger ctor, dtor public needed for cppgc::MakeGarbageCollected() This is what upstream does, e.g. https://chromium-review.googlesource.com/c/chromium/src/+/6722236 * fixup! refactor: remove unused isolate arg from Debugger ctor mark Debugger ctor as explicit * refactor: in EventEmitterMixin, handle both old and new WrapperInfo types * refactor: make electron::api::Debugger inherit from gin::Wrappable * refactor: add api::Debugger::GetTypeName() * refactor: add api::Debugger::GetClassName()
nilayarya
added a commit
to nilayarya/electron
that referenced
this pull request
Nov 21, 2025
* refactor: remove unused isolate arg from Debugger ctor * refactor: make Debugger ctor, dtor public needed for cppgc::MakeGarbageCollected() This is what upstream does, e.g. https://chromium-review.googlesource.com/c/chromium/src/+/6722236 * fixup! refactor: remove unused isolate arg from Debugger ctor mark Debugger ctor as explicit * refactor: in EventEmitterMixin, handle both old and new WrapperInfo types * refactor: make electron::api::Debugger inherit from gin::Wrappable * refactor: add api::Debugger::GetTypeName() * refactor: add api::Debugger::GetClassName()
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of Change
Part of #47922
api::Debugger is lazy-constructed when
electron::api::WebContents::Debugger()is called, and it persists for the life of the web contents. The following changes are made in this PR:Debugger::Debugger()a little by removing the unusedv8::Isolate*argumentEventEmitterMixinto support bothWrappableInfoandDeprecatedWrappableInfo. Support for the latter will be removed after all our code has been migrated toWrappableInfo.electron::api::Debuggerto inherit fromgin::Wrappableinstead ofgin_helper::DeprecatedWrappable.electron::api::WebContents::debugger_to acppgc::Persistent<Debugger>.CC @deepak1556
Pushing this draft PR up for early review. Still needs tests and a prefinalizer to detach from DevToolsAgentHost
Checklist
npm testpassesRelease Notes
Notes: no-notes