New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add net module to utility process #40017
Conversation
💖 Thanks for opening this pull request! 💖 We use semantic commit messages to streamline the release process. Before your pull request can be merged, you should update your pull request title to start with a semantic prefix. Examples of commit messages with semantic prefixes:
Things that will help get your PR across the finish line:
We get a lot of pull requests on this repo, so please be patient and we will get back to you as soon as we can. |
b8652aa
to
1927064
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haven't reviewed the content here but a question for folks with opinions @deepak1556 maybe.
I believe that shell/common
is supposed to imply that code inside can run in any process, moving the net stuff into common would imply it would work in the renderer process which I don't think is correct 🤔 Thoughts on where this code should live?
I couldn't suggest a better home with the current directory structure, but maybe following options can also be considered
|
eaaedf5
to
36ff581
Compare
Alright all of the planned follow items are completed here. For Any reviews or guidance through the process is much appreciated! 🙏 |
Some unrelated changed get pulled in to |
Sure thing @dsanders11, opened #40264 |
Oh it might be better left as part of this PR actually. Otherwise there are no utility process modules documented and the typescript definition generation fails. |
Can |
👍 On it! |
|
36ff581
to
5080163
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
API LGTM
ddd45e0
to
ed15470
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
API LGTM
@devm33 looks like the newly added test is failing on linux: https://app.circleci.com/pipelines/github/electron/electron/76406/workflows/f315658a-de1f-4549-93c1-52080f4d7300/jobs/1637154 |
9a5982e
to
e11b9b3
Compare
If there are no other concerns, I plan to merge this PR today and follow-up on the system network context usage for net apis. |
Release Notes Persisted
|
I have automatically backported this PR to "29-x-y", please check out #40890 |
/trop run backport-to 28-x-y |
The backport process for this PR has been manually initiated - sending your PR to |
I have automatically backported this PR to "28-x-y", please check out #40967 |
feat: add net module to utility process (#40017) Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
feat: add net module to utility process (#40017) Co-authored-by: Milan Burda <miburda@microsoft.com>
Description of Change
Adds electron.net module to the utility-process. This enables making network calls from the utility process with the full capabilities of Chromium's native networking instead of the Node.js implementation. Example benefits include system TLS certificates, system proxy settings, support for basic, digest, NTLM, Kerberos, and negotiate authentication schemes.
The current net API in the main process requires any request from the utility process to be proxied via the main process UI thread. This PR makes it that main process establishes the
URLLoaderFactory
connection with the Network service and passes the remote endpoint to the utility process allowing it make requests directly with the Network service. This is borrowed on the same principle as renderer process perform today to make network requests.Closes microsoft/vscode#192899
CC @deepak1556
Note: opening this with some remaining clean up work todo in order to get early feedback.RemainingCompleted clean up work:electron/utility
module to docs-parser and typescript-definitions repos @devm33electron/utility
module is available @deepak1556loader_params->process_id
to use utility process pid instead ofkBrowserProcessId
@devm33electron_api_net.cc
from browser to common and rename linked binding @devm33Checklist
npm test
passesRelease Notes
Notes: Added net module to utility process.