chore: cache URLLoaderFactory per-session (#19998)

* cache the URLLoaderFactory in AtomBrowserContext

* use cached loader factory in AtomURLLoaderFactory
This commit is contained in:
Cheng Zhao 2019-08-29 15:07:46 +09:00 committed by GitHub
parent eed72c35d7
commit b3947d6a83
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 50 additions and 40 deletions

View file

@ -396,12 +396,9 @@ void AtomURLLoaderFactory::StartLoadingHttp(
}
}
scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory =
content::BrowserContext::GetDefaultStoragePartition(browser_context.get())
->GetURLLoaderFactoryForBrowserProcess();
new URLPipeLoader(
url_loader_factory, std::move(request), std::move(loader),
std::move(client),
browser_context->GetURLLoaderFactory(), std::move(request),
std::move(loader), std::move(client),
static_cast<net::NetworkTrafficAnnotationTag>(traffic_annotation),
std::move(upload_data));
}