Repository navigation
refactor: allocate api::Session on cpp heap - #48141
Merged
Merged
Conversation
deepak1556
force-pushed
the
robo/make_api_session_gin_wrappable
branch
2 times, most recently
from
August 21, 2025 16:44
0e4097b to
ed7b41d
Compare
deepak1556
marked this pull request as ready for review
August 21, 2025 16:45
deepak1556
marked this pull request as draft
August 21, 2025 16:54
deepak1556
force-pushed
the
robo/make_api_session_gin_wrappable
branch
from
August 21, 2025 17:28
ed7b41d to
37ce525
Compare
deepak1556
marked this pull request as ready for review
August 22, 2025 03:56
codebytere
approved these changes
Aug 25, 2025
|
Release Notes Persisted
|
dodolalorc
pushed a commit
to dodolalorc/electron
that referenced
this pull request
Sep 11, 2025
2 of 5 tasks
kigh-ota
pushed a commit
to kigh-ota/electron
that referenced
this pull request
Sep 30, 2025
3 tasks done
2 tasks done
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::Sessionis persisted for the lifetime of the process and gets destroyed viaCleanupAtExithook that runs before the microtask runner destruction. The following changes are made in this PR,gin::kElectronSessionthat will be used to verify the wrapper objectgin::Pinnable<T>is replaced withgin_helper::SelfKeepAlive<T>which retains a persistent pointer to the on-heap objectbase::WeakPtr<Session>that is used to associate with a BrowserContext is now replaced withgin::WeakCell<Session>JavascriptEnvironmentas part of the platform destructionelectron/shell/browser/electron_browser_main_parts.cc
Lines 590 to 596 in 1044fe6
js_env_to be destroyed earlier but that cannot happen till we finish the transition of all wrappable to cpp heap. As a temporary transition, there is now agin::PerIsolateData::DisposeObserver::OnBeforeMicrotasksRunnerDisposehook that will help maintain the current lifetime.Release Notes
Notes:
sessionmodule backing C++ object is now managed by v8