Repository navigation
refactor: remove electron::WebRequestAPI interface - #48792
Merged
deepak1556 merged 4 commits intoNov 6, 2025
Merged
Conversation
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|.
ckerr
marked this pull request as ready for review
November 5, 2025 20:51
deepak1556
deleted the
refactor/remove-electron-WebRequestAPI-interface
branch
November 6, 2025 08:05
|
No Release Notes |
3 tasks done
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
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
* 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
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
What:
Remove the
electron::WebRequestAPIinterface class. Use handles to the concrete classelectron::api::WebRequestinstead.Why:
Prerequisite for #48762.
Two classes (
electron::ProxyingURLLoaderFactoryandelectron::ProxyingWebSocket) hold a handle to a WebRequest viaraw_ptr<electron::WebRequestAPI>.electron::WebRequestAPIis a pure virtual interface whose concrete impl iselectron::api::WebRequest.This is a problem when migrating
electron::api::WebRequestto cppgc: we need to change thoseraw_ptr<>s tocppgc::WeakPersistent<>but can't instantiatecppgc::WeakPersistent<electron::WebRequestAPI>as-is. We also can't change it to inherit fromcppgc::GarbageCollectedMixin, since that causes problems whenelectron::api::WebRequestinherits from bothelectron::WebRequestAPIandcppgc::GarbageCollected.CC @deepak1556
Checklist
npm testpassesRelease Notes
Notes: none.