feat: migrate protocol module to NetworkService (Part 9) (#18374)
* Compare final data instead of url The behavior of did-finish-load and getURL has changed for redirects when using NetworkService, so the test fails for NetworkService. Comparing the finally received data makes the test more reliable. * Implement intercept APIs * Setting mimeType should set "content-type" header * Passing no argument should not throw JS error * Don't access api namespace in ProxyingURLLoaderFactory * No need to create AtomURLLoaderFactory every time * No use of weak factory
This commit is contained in:
parent
646f572b77
commit
54cbe5f749
8 changed files with 120 additions and 38 deletions
|
@ -969,13 +969,16 @@ bool AtomBrowserClient::WillCreateURLLoaderFactory(
|
|||
bool* bypass_redirect_checks) {
|
||||
content::WebContents* web_contents =
|
||||
content::WebContents::FromRenderFrameHost(frame_host);
|
||||
if (!web_contents)
|
||||
api::ProtocolNS* protocol = api::ProtocolNS::FromWrappedClass(
|
||||
v8::Isolate::GetCurrent(), web_contents->GetBrowserContext());
|
||||
if (!protocol)
|
||||
return false;
|
||||
|
||||
auto proxied_request = std::move(*factory_request);
|
||||
network::mojom::URLLoaderFactoryPtrInfo target_factory_info;
|
||||
*factory_request = mojo::MakeRequest(&target_factory_info);
|
||||
new ProxyingURLLoaderFactory(std::move(proxied_request),
|
||||
new ProxyingURLLoaderFactory(protocol->intercept_handlers(),
|
||||
std::move(proxied_request),
|
||||
std::move(target_factory_info));
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue