Repository navigation
refactor: make api::WebRequest inherit from gin::Wrappable - #48762
Merged
Merged
Conversation
api::WebRequest inherit from gin::Wrappable
ckerr
marked this pull request as draft
November 4, 2025 03:29
ckerr
force-pushed
the
refactor/oilpan-api-web-request
branch
from
November 4, 2025 16:11
83582f4 to
ecb3eef
Compare
ckerr
force-pushed
the
refactor/oilpan-api-web-request
branch
from
November 5, 2025 03:44
ecb3eef to
5638291
Compare
deepak1556
reviewed
Nov 5, 2025
ckerr
added a commit
that referenced
this pull request
Nov 5, 2025
Remove the |electron::WebRequestAPI| interface class. Use handles to the concrete class |electron::api::WebRequest| instead. Prerequisite for #48762. Two classes (electron::ProxyingURLLoaderFactory and electron::ProxyingWebSocket) hold a handle to a WebRequest via |raw_ptr<electron::WebRequestAPI>|. |electron::WebRequestAPI| is a pure virtual interface whose concrete impl is |electron::api::WebRequest|. This is a problem when migrating |electron::api::WebRequest| to cppgc: we need to change those |raw_ptr<>|s to |cppgc::WeakPersistent<>| but can't instantiate |cppgc::WeakPersistent<electron::WebRequestAPI>| as-is. We also can't change it to inherit from |cppgc::GarbageCollectedMixin|, since that causes problems when |electron::api::WebRequest| inherits from both |electron::WebRequestAPI| and |cppgc::GarbageCollected|.
3 tasks done
deepak1556
pushed a commit
that referenced
this pull request
Nov 6, 2025
* refactor: remove electron::WebRequestAPI interface Remove the |electron::WebRequestAPI| interface class. Use handles to the concrete class |electron::api::WebRequest| instead. Prerequisite for #48762. Two classes (electron::ProxyingURLLoaderFactory and electron::ProxyingWebSocket) hold a handle to a WebRequest via |raw_ptr<electron::WebRequestAPI>|. |electron::WebRequestAPI| is a pure virtual interface whose concrete impl is |electron::api::WebRequest|. This is a problem when migrating |electron::api::WebRequest| to cppgc: we need to change those |raw_ptr<>|s to |cppgc::WeakPersistent<>| but can't instantiate |cppgc::WeakPersistent<electron::WebRequestAPI>| as-is. We also can't change it to inherit from |cppgc::GarbageCollectedMixin|, since that causes problems when |electron::api::WebRequest| inherits from both |electron::WebRequestAPI| and |cppgc::GarbageCollected|. * refactor: use name web_request, not web_request_api * refactor: make ProxyingURLLoaderFactory::web_request() private * chore: make linter happy by fixing whitespace
ckerr
force-pushed
the
refactor/oilpan-api-web-request
branch
from
November 6, 2025 19:56
5638291 to
ec51a34
Compare
Member
Author
|
I've addressed the current code feedback but I'm going to leave it in draft form for now. TODO:
|
3 tasks done
ckerr
force-pushed
the
refactor/oilpan-api-web-request
branch
from
November 9, 2025 15:38
97cde6c to
7add606
Compare
2 tasks done
ckerr
marked this pull request as ready for review
November 10, 2025 22:38
Member
Author
|
@deepak1556 @codebytere this is finally ready for review; I've rebased it + updated it after #48848. |
deepak1556
reviewed
Nov 11, 2025
deepak1556
left a comment
Member
There was a problem hiding this comment.
Needs another rebase to adjust for #48512, particularly around gin::weakcell adoption for the auth result callback.
ckerr
force-pushed
the
refactor/oilpan-api-web-request
branch
from
November 12, 2025 00:59
50eee73 to
9a7930a
Compare
refactor: remove unused v8::Isolate* arg from WebRequest ctor refactor: make electron::api::Session::web_request_ a cppgc::Member<api::WebRequest> refactor: allocate api::WebRequest on cpp heap refactor: modify Create(), Find(), and FindOrCreate() to return a WebRequest*
…nstead of a WebRequestAPI Experimental commit to ensure `ProxyingURLLoaderFactory::web_request_api_` won't be a dangling pointer.
…ndleOnBeforeRequestResponseEvent()
ckerr
force-pushed
the
refactor/oilpan-api-web-request
branch
from
November 12, 2025 15:57
9a7930a to
a4a12e3
Compare
|
No Release Notes |
nilayarya
pushed a commit
to nilayarya/electron
that referenced
this pull request
Nov 21, 2025
* refactor: remove electron::WebRequestAPI interface Remove the |electron::WebRequestAPI| interface class. Use handles to the concrete class |electron::api::WebRequest| instead. Prerequisite for electron#48762. Two classes (electron::ProxyingURLLoaderFactory and electron::ProxyingWebSocket) hold a handle to a WebRequest via |raw_ptr<electron::WebRequestAPI>|. |electron::WebRequestAPI| is a pure virtual interface whose concrete impl is |electron::api::WebRequest|. This is a problem when migrating |electron::api::WebRequest| to cppgc: we need to change those |raw_ptr<>|s to |cppgc::WeakPersistent<>| but can't instantiate |cppgc::WeakPersistent<electron::WebRequestAPI>| as-is. We also can't change it to inherit from |cppgc::GarbageCollectedMixin|, since that causes problems when |electron::api::WebRequest| inherits from both |electron::WebRequestAPI| and |cppgc::GarbageCollected|. * refactor: use name web_request, not web_request_api * refactor: make ProxyingURLLoaderFactory::web_request() private * chore: make linter happy by fixing whitespace
nilayarya
pushed a commit
to nilayarya/electron
that referenced
this pull request
Nov 21, 2025
…ron#48762) * refactor: make api::WebRequest inherit from gin::Wrappable refactor: remove unused v8::Isolate* arg from WebRequest ctor refactor: make electron::api::Session::web_request_ a cppgc::Member<api::WebRequest> refactor: allocate api::WebRequest on cpp heap refactor: modify Create(), Find(), and FindOrCreate() to return a WebRequest* * refactor: ProxyingURLLoaderFactory takes a concrete api::WebRequest instead of a WebRequestAPI Experimental commit to ensure `ProxyingURLLoaderFactory::web_request_api_` won't be a dangling pointer. * chore: fix doc shear * refactor: use cppgc::WeakPersistent<> in ProxyingURLLoaderFactory * refactor: make ProxyingURLLoaderFactory::web_request_ const * refactor: make ProxyingWebSocket::web_request_ a cppgc::WeakPersistent<> * add a gin::WeakCellFactory to api::WebRequest * refactor: use a gin::WeakCell for the bound WebRequest argument in HandleOnBeforeRequestResponseEvent() * chore: update patches
nilayarya
added a commit
to nilayarya/electron
that referenced
this pull request
Nov 21, 2025
* refactor: remove electron::WebRequestAPI interface Remove the |electron::WebRequestAPI| interface class. Use handles to the concrete class |electron::api::WebRequest| instead. Prerequisite for electron#48762. Two classes (electron::ProxyingURLLoaderFactory and electron::ProxyingWebSocket) hold a handle to a WebRequest via |raw_ptr<electron::WebRequestAPI>|. |electron::WebRequestAPI| is a pure virtual interface whose concrete impl is |electron::api::WebRequest|. This is a problem when migrating |electron::api::WebRequest| to cppgc: we need to change those |raw_ptr<>|s to |cppgc::WeakPersistent<>| but can't instantiate |cppgc::WeakPersistent<electron::WebRequestAPI>| as-is. We also can't change it to inherit from |cppgc::GarbageCollectedMixin|, since that causes problems when |electron::api::WebRequest| inherits from both |electron::WebRequestAPI| and |cppgc::GarbageCollected|. * refactor: use name web_request, not web_request_api * refactor: make ProxyingURLLoaderFactory::web_request() private * chore: make linter happy by fixing whitespace
nilayarya
added a commit
to nilayarya/electron
that referenced
this pull request
Nov 21, 2025
…ron#48762) * refactor: make api::WebRequest inherit from gin::Wrappable refactor: remove unused v8::Isolate* arg from WebRequest ctor refactor: make electron::api::Session::web_request_ a cppgc::Member<api::WebRequest> refactor: allocate api::WebRequest on cpp heap refactor: modify Create(), Find(), and FindOrCreate() to return a WebRequest* * refactor: ProxyingURLLoaderFactory takes a concrete api::WebRequest instead of a WebRequestAPI Experimental commit to ensure `ProxyingURLLoaderFactory::web_request_api_` won't be a dangling pointer. * chore: fix doc shear * refactor: use cppgc::WeakPersistent<> in ProxyingURLLoaderFactory * refactor: make ProxyingURLLoaderFactory::web_request_ const * refactor: make ProxyingWebSocket::web_request_ a cppgc::WeakPersistent<> * add a gin::WeakCellFactory to api::WebRequest * refactor: use a gin::WeakCell for the bound WebRequest argument in HandleOnBeforeRequestResponseEvent() * chore: update patches
nilayarya
added a commit
to nilayarya/electron
that referenced
this pull request
Nov 21, 2025
* refactor: remove electron::WebRequestAPI interface Remove the |electron::WebRequestAPI| interface class. Use handles to the concrete class |electron::api::WebRequest| instead. Prerequisite for electron#48762. Two classes (electron::ProxyingURLLoaderFactory and electron::ProxyingWebSocket) hold a handle to a WebRequest via |raw_ptr<electron::WebRequestAPI>|. |electron::WebRequestAPI| is a pure virtual interface whose concrete impl is |electron::api::WebRequest|. This is a problem when migrating |electron::api::WebRequest| to cppgc: we need to change those |raw_ptr<>|s to |cppgc::WeakPersistent<>| but can't instantiate |cppgc::WeakPersistent<electron::WebRequestAPI>| as-is. We also can't change it to inherit from |cppgc::GarbageCollectedMixin|, since that causes problems when |electron::api::WebRequest| inherits from both |electron::WebRequestAPI| and |cppgc::GarbageCollected|. * refactor: use name web_request, not web_request_api * refactor: make ProxyingURLLoaderFactory::web_request() private * chore: make linter happy by fixing whitespace
nilayarya
added a commit
to nilayarya/electron
that referenced
this pull request
Nov 21, 2025
…ron#48762) * refactor: make api::WebRequest inherit from gin::Wrappable refactor: remove unused v8::Isolate* arg from WebRequest ctor refactor: make electron::api::Session::web_request_ a cppgc::Member<api::WebRequest> refactor: allocate api::WebRequest on cpp heap refactor: modify Create(), Find(), and FindOrCreate() to return a WebRequest* * refactor: ProxyingURLLoaderFactory takes a concrete api::WebRequest instead of a WebRequestAPI Experimental commit to ensure `ProxyingURLLoaderFactory::web_request_api_` won't be a dangling pointer. * chore: fix doc shear * refactor: use cppgc::WeakPersistent<> in ProxyingURLLoaderFactory * refactor: make ProxyingURLLoaderFactory::web_request_ const * refactor: make ProxyingWebSocket::web_request_ a cppgc::WeakPersistent<> * add a gin::WeakCellFactory to api::WebRequest * refactor: use a gin::WeakCell for the bound WebRequest argument in HandleOnBeforeRequestResponseEvent() * chore: update patches
This was referenced Nov 24, 2025
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
electron::api::WebRequestto inherit fromgin::Wrappableinstead ofgin_helper::DeprecatedWrappableelectron::api::Session::web_request_to be acppgc::Member<WebRequest>instead of av8::TracedReference<v8::Value>v8::Isolate*argument fromelectron::api::WebRequestconstructorWebRequest::Create(),WebRequest::Find(),andWebRequest::FindOrCreate()to return anapi::WebRequest*CC @deepak1556 as a #47922 stakeholder. All reviews welcomed.
Checklist
npm testpassesRelease Notes
Notes: none