feat: migrate webRequest module to NetworkService (Part 9) (#19976)
* no need to get WebContents for URLLoaderFactory * consult embedder for network_factory created in net module * set disable_web_security to false * re-enable webRequest tests in net module
This commit is contained in:
parent
bdb20d53cb
commit
4eee71ffbf
3 changed files with 35 additions and 13 deletions
|
@ -988,18 +988,11 @@ bool AtomBrowserClient::WillCreateURLLoaderFactory(
|
|||
mojo::PendingReceiver<network::mojom::URLLoaderFactory>* factory_receiver,
|
||||
network::mojom::TrustedURLLoaderHeaderClientPtrInfo* header_client,
|
||||
bool* bypass_redirect_checks) {
|
||||
content::WebContents* web_contents =
|
||||
content::WebContents::FromRenderFrameHost(frame_host);
|
||||
// For service workers there might be no WebContents.
|
||||
if (!web_contents)
|
||||
return false;
|
||||
|
||||
v8::Isolate* isolate = v8::Isolate::GetCurrent();
|
||||
api::ProtocolNS* protocol = api::ProtocolNS::FromWrappedClass(
|
||||
isolate, web_contents->GetBrowserContext());
|
||||
api::ProtocolNS* protocol =
|
||||
api::ProtocolNS::FromWrappedClass(isolate, browser_context);
|
||||
DCHECK(protocol);
|
||||
auto web_request = api::WebRequestNS::FromOrCreate(
|
||||
isolate, web_contents->GetBrowserContext());
|
||||
auto web_request = api::WebRequestNS::FromOrCreate(isolate, browser_context);
|
||||
DCHECK(web_request.get());
|
||||
|
||||
auto proxied_receiver = std::move(*factory_receiver);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue