feat: support app#login event for utility process net requests (#43317)

* feat: support app#login event for utility process net requests

* feat: support app#login event for utility process net requests

* chore: address review feedback

* GlobalRequestID: Avoid unwanted inlining and narrowing int conversions

Refs 5702737

* chore: fix lint
This commit is contained in:
Robo 2024-08-16 18:24:19 +09:00 committed by GitHub
parent 7123b313cf
commit 8c1be5ade2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 536 additions and 37 deletions

View file

@ -20,6 +20,7 @@
#include "mojo/public/cpp/bindings/receiver.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "shell/browser/event_emitter_mixin.h"
#include "shell/browser/net/url_loader_network_observer.h"
#include "shell/common/gin_helper/pinnable.h"
#include "shell/services/node/public/mojom/node_service.mojom.h"
#include "v8/include/v8.h"
@ -64,7 +65,8 @@ class UtilityProcessWrapper
std::map<IOHandle, IOType> stdio,
base::EnvironmentMap env_map,
base::FilePath current_working_directory,
bool use_plugin_helper);
bool use_plugin_helper,
bool create_network_observer);
void OnServiceProcessLaunch(const base::Process& process);
void CloseConnectorPort();
@ -99,6 +101,8 @@ class UtilityProcessWrapper
std::unique_ptr<mojo::Connector> connector_;
blink::MessagePortDescriptor host_port_;
mojo::Remote<node::mojom::NodeService> node_service_remote_;
std::optional<electron::URLLoaderNetworkObserver>
url_loader_network_observer_;
base::WeakPtrFactory<UtilityProcessWrapper> weak_factory_{this};
};