Skip to content

refactor: make api::NetLog inherit from gin::Wrappable - #48308

Merged
deepak1556 merged 5 commits into
mainfrom
refactor/gin-wrappable-api-net-log
Sep 15, 2025
Merged

deepak1556 merged 5 commits into
mainfrom
refactor/gin-wrappable-api-net-log

Conversation

@ckerr

@ckerr ckerr commented Sep 12, 2025

Copy link
Copy Markdown
Member

Description of Change

Part of #47922

  • Refactor electron::api::NetLog to inherit from gin::Wrappable instead of gin_helper::DeprecatedWrappable
  • Refactor electron::api::Session::net_log_ to be a cppgc::Persistent<NetLog> instead of a v8::TracedReference<v8::Value>
  • Remove unused v8::Isolate* argument from electron::api::NetLog constructor

I haven't added any new tests for this: since Session::net_log_ persists for the life of the session, it seems like the existing tests should be enough to exercise this refactor? I'd welcome a second opinion on this.

Checklist

Release Notes

Notes: none.

@ckerr
ckerr requested a review from deepak1556 September 12, 2025 20:09
@ckerr
ckerr requested a review from a team as a code owner September 12, 2025 20:09
@electron-cation electron-cation Bot added the new-pr 🌱 PR opened recently label Sep 12, 2025
@ckerr ckerr changed the title Refactor/gin wrappable api net log refactor: make api::NetLog inherit from gin::Wrappable Sep 12, 2025
@ckerr
ckerr force-pushed the refactor/gin-wrappable-api-net-log branch from efc2495 to 309e97f Compare September 15, 2025 14:08
+ kElectronEvent, // gin_helper::internal::Event
+ kElectronNetLog, // electron::api::NetLog
+ kElectronSession, // electron::api::Session
+ kLastPointerTag = kElectronEvent,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kLastPointerTag should be updated, in this case kElectronSession but can be done in the next refactor PR.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. I'll watch out for that next time I sort the group 👍

@deepak1556
deepak1556 merged commit 15cdae1 into main Sep 15, 2025
@deepak1556
deepak1556 deleted the refactor/gin-wrappable-api-net-log branch September 15, 2025 21:29
@release-clerk

release-clerk Bot commented Sep 15, 2025

Copy link
Copy Markdown

No Release Notes

kigh-ota pushed a commit to kigh-ota/electron that referenced this pull request Sep 30, 2025
* refactor: remove unused v8::Isolate* arg from NetLog ctor

* refactor: allocate api::NetLog on cpp heap

* refactor: make electron::api::Session::net_log_ a cppgc::Member<api::NetLog>

* refactor: remove unnecessary EscapableHandleScope

* chore: code style consistency
@ckerr ckerr mentioned this pull request Nov 3, 2025
2 tasks done
nilayarya pushed a commit to nilayarya/electron that referenced this pull request Nov 21, 2025
* refactor: remove unused v8::Isolate* arg from NetLog ctor

* refactor: allocate api::NetLog on cpp heap

* refactor: make electron::api::Session::net_log_ a cppgc::Member<api::NetLog>

* refactor: remove unnecessary EscapableHandleScope

* chore: code style consistency
nilayarya added a commit to nilayarya/electron that referenced this pull request Nov 21, 2025
* refactor: remove unused v8::Isolate* arg from NetLog ctor

* refactor: allocate api::NetLog on cpp heap

* refactor: make electron::api::Session::net_log_ a cppgc::Member<api::NetLog>

* refactor: remove unnecessary EscapableHandleScope

* chore: code style consistency
nilayarya added a commit to nilayarya/electron that referenced this pull request Nov 21, 2025
* refactor: remove unused v8::Isolate* arg from NetLog ctor

* refactor: allocate api::NetLog on cpp heap

* refactor: make electron::api::Session::net_log_ a cppgc::Member<api::NetLog>

* refactor: remove unnecessary EscapableHandleScope

* chore: code style consistency
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants