Commit 707fa79d authored by Matt Menke's avatar Matt Menke Committed by Commit Bot

NetworkService: Clean up URLRequestContext creation.

As of https://chromium-review.googlesource.com/c/chromium/src/+/1096075,
URLRequestContextBuilderMojo no longer needs to call into
NetworkContext as part of IOThread/ProfileIOData setup when the network
service is enabled.

This means we can make NetworkContext::ApplyContextParamsToBuilder
non-static, and remove its rather long argument list.

Bug: 825242
Cq-Include-Trybots: luci.chromium.try:linux_mojo
Change-Id: Iecf240f3091c9f57380e0f06d2e455532ccff4ab
Reviewed-on: https://chromium-review.googlesource.com/1104808Reviewed-by: default avatarHelen Li <xunjieli@chromium.org>
Commit-Queue: Matt Menke <mmenke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#568257}
parent 3071401e
This diff is collapsed.
......@@ -35,9 +35,6 @@
namespace net {
class CertVerifier;
class HostResolver;
class HttpAuthHandlerFactory;
class NetworkQualityEstimator;
class ReportSender;
class StaticHttpUserAgentSettings;
class URLRequestContext;
......@@ -46,7 +43,6 @@ class URLRequestContext;
namespace certificate_transparency {
class ChromeRequireCTDelegate;
class TreeStateTracker;
class STHReporter;
} // namespace certificate_transparency
namespace network {
......@@ -207,29 +203,11 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
private:
class ContextNetworkDelegate;
friend class URLRequestContextBuilderMojo;
// Applies the values in |network_context_params| to |builder|, and builds
// the URLRequestContext. If |out_http_user_agent_settings| is non-null, it
// will be set to point to StaticHttpUserAgentSettings owned by the
// Applies the values in |params_| to |builder|, and builds the
// URLRequestContext.
static URLRequestContextOwner ApplyContextParamsToBuilder(
URLRequestContextBuilderMojo* builder,
mojom::NetworkContextParams* network_context_params,
bool quic_disabled,
net::NetLog* net_log,
net::HostResolver* host_resolver,
net::NetworkQualityEstimator* network_quality_estimator,
net::HttpAuthHandlerFactory* http_auth_handler_factory,
certificate_transparency::STHReporter* sth_reporter,
std::unique_ptr<certificate_transparency::TreeStateTracker>*
out_tree_state_tracker,
std::unique_ptr<certificate_transparency::ChromeRequireCTDelegate>*
out_require_ct_delegate,
std::unique_ptr<net::ReportSender>* out_certificate_report_sender,
std::unique_ptr<ExpectCTReporter>* out_expect_ct_reporter,
net::StaticHttpUserAgentSettings** out_http_user_agent_settings,
ContextNetworkDelegate** out_context_network_delegate_ptr);
URLRequestContextOwner ApplyContextParamsToBuilder(
URLRequestContextBuilderMojo* builder);
// Invoked when the HTTP cache was cleared. Invokes |callback|.
void OnHttpCacheCleared(ClearHttpCacheCallback callback,
......@@ -239,7 +217,6 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
void OnConnectionError();
URLRequestContextOwner MakeURLRequestContext(
mojom::NetworkContextParams* network_context_params,
SessionCleanupCookieStore** session_cleanup_cookie_store);
NetworkService* const network_service_;
......
......@@ -33,23 +33,6 @@ void URLRequestContextBuilderMojo::SetMojoProxyResolverFactory(
mojo_proxy_resolver_factory_ = std::move(mojo_proxy_resolver_factory);
}
URLRequestContextOwner URLRequestContextBuilderMojo::Create(
mojom::NetworkContextParams* params,
bool quic_disabled,
net::NetLog* net_log,
net::HostResolver* host_resolver,
net::NetworkQualityEstimator* network_quality_estimator) {
return NetworkContext::ApplyContextParamsToBuilder(
this, params, quic_disabled, net_log, host_resolver,
network_quality_estimator, nullptr /* http_auth_handler_factory */,
nullptr /* sth_distributor */, nullptr /* out_ct_tree_tracker */,
nullptr /* out_require_ct_delegate */,
nullptr /* out_certificate_report_sender */,
nullptr /* out_expect_ct_reporter */,
nullptr /* out_static_user_agent_settings */,
nullptr /* out_context_network_delegate */);
}
std::unique_ptr<net::ProxyResolutionService>
URLRequestContextBuilderMojo::CreateProxyResolutionService(
std::unique_ptr<net::ProxyConfigService> proxy_config_service,
......
......@@ -48,20 +48,6 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) URLRequestContextBuilderMojo
proxy_resolver::mojom::ProxyResolverFactoryPtr
mojo_proxy_resolver_factory);
// Can be used to create a URLRequestContext from this consumer-configured
// URLRequestContextBuilder, which |params| will then be applied to. The
// results URLRequestContext will be returned along with other state that it
// depends on. The URLRequestContext can be further modified before first use.
//
// This method is intended to ease the transition to an out-of-process
// NetworkService, and will be removed once that ships.
URLRequestContextOwner Create(
mojom::NetworkContextParams* params,
bool quic_disabled,
net::NetLog* net_log,
net::HostResolver* host_resolver,
net::NetworkQualityEstimator* network_quality_estimator);
private:
std::unique_ptr<net::ProxyResolutionService> CreateProxyResolutionService(
std::unique_ptr<net::ProxyConfigService> proxy_config_service,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment