-
Notifications
You must be signed in to change notification settings - Fork 35.7k
Description
It is of interest to apps to handle the login event with some UI in the main process that are triggered from the net API in the utility process. This is not possible today since the network::URLLoader only takes the observer that is passed in via the TrustedParams if not available then fallbacks to the one provided by URLLoaderFactory.
We can provide an option in the net API of the utility process to listen and respond to the observer events from the main process, this is already done for auth requests from renderer and service workers. StoragePartitionImpl acts as the observer in this case and eventually provides a way for embedder to respond to these requests via content::BrowserClient::CreateLoginDelegate. Electron already hooks into this interceptor and provides the app.#login event. We would need to add new wrapper method CreateAuthCertObserverForUtilityProcess, the primary need for this new wrapper is to avoid devtools interception in StoragePartitionImpl::LoginHandlerDelegate and also to uniquely identify requests from the utility process via the new enum kUtilityProcessContext.