Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(297)

Unified Diff: net/url_request/url_request_context_builder.cc

Issue 2888043008: Revert of Allow use of Mojo/V8 ProxyResolvers with URLRequestContextBuilder. (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/url_request/url_request_context_builder.h ('k') | net/url_request/url_request_context_builder_v8.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_request_context_builder.cc
diff --git a/net/url_request/url_request_context_builder.cc b/net/url_request/url_request_context_builder.cc
index 3309974be90ac108918e91953d000a6697fbe923..40e842dca12717b8dc5a0b8b994866eb6230d33e 100644
--- a/net/url_request/url_request_context_builder.cc
+++ b/net/url_request/url_request_context_builder.cc
@@ -133,23 +133,13 @@
};
// Define a context class that can self-manage the ownership of its components
-// via a UrlRequestContextStorage object. Since it cancels requests in its
-// destructor, it's not safe to subclass this.
-class ContainerURLRequestContext final : public URLRequestContext {
+// via a UrlRequestContextStorage object.
+class ContainerURLRequestContext : public URLRequestContext {
public:
explicit ContainerURLRequestContext(
const scoped_refptr<base::SingleThreadTaskRunner>& file_task_runner)
: file_task_runner_(file_task_runner), storage_(this) {}
-
- ~ContainerURLRequestContext() override {
- // Shut down the ProxyService, as it may have pending URLRequests using this
- // context. Since this cancels requests, it's not safe to subclass this, as
- // some parts of the URLRequestContext may then be torn down before this
- // cancels the ProxyService's URLRequests.
- proxy_service()->OnShutdown();
-
- AssertNoURLRequests();
- }
+ ~ContainerURLRequestContext() override { AssertNoURLRequests(); }
URLRequestContextStorage* storage() {
return &storage_;
@@ -368,6 +358,22 @@
}
storage->set_host_resolver(std::move(host_resolver_));
+ if (!proxy_service_) {
+ // TODO(willchan): Switch to using this code when
+ // ProxyService::CreateSystemProxyConfigService()'s signature doesn't suck.
+#if !defined(OS_LINUX) && !defined(OS_ANDROID)
+ if (!proxy_config_service_) {
+ proxy_config_service_ = ProxyService::CreateSystemProxyConfigService(
+ base::ThreadTaskRunnerHandle::Get().get(),
+ context->GetFileTaskRunner());
+ }
+#endif // !defined(OS_LINUX) && !defined(OS_ANDROID)
+ proxy_service_ = ProxyService::CreateUsingSystemProxyResolver(
+ std::move(proxy_config_service_),
+ context->net_log());
+ }
+ storage->set_proxy_service(std::move(proxy_service_));
+
storage->set_ssl_config_service(new SSLConfigServiceDefaults);
if (!http_auth_handler_factory_) {
@@ -433,23 +439,6 @@
storage->set_throttler_manager(
base::MakeUnique<URLRequestThrottlerManager>());
}
-
- if (!proxy_service_) {
-#if !defined(OS_LINUX) && !defined(OS_ANDROID)
- // TODO(willchan): Switch to using this code when
- // ProxyService::CreateSystemProxyConfigService()'s signature doesn't suck.
- if (!proxy_config_service_) {
- proxy_config_service_ = ProxyService::CreateSystemProxyConfigService(
- base::ThreadTaskRunnerHandle::Get().get(),
- context->GetFileTaskRunner());
- }
-#endif // !defined(OS_LINUX) && !defined(OS_ANDROID)
- proxy_service_ =
- CreateProxyService(std::move(proxy_config_service_), context.get(),
- context->host_resolver(),
- context->network_delegate(), context->net_log());
- }
- storage->set_proxy_service(std::move(proxy_service_));
HttpNetworkSession::Params network_session_params;
SetHttpNetworkSessionComponents(context.get(), &network_session_params);
@@ -536,14 +525,4 @@
return std::move(context);
}
-std::unique_ptr<ProxyService> URLRequestContextBuilder::CreateProxyService(
- std::unique_ptr<ProxyConfigService> proxy_config_service,
- URLRequestContext* url_request_context,
- HostResolver* host_resolver,
- NetworkDelegate* network_delegate,
- NetLog* net_log) {
- return ProxyService::CreateUsingSystemProxyResolver(
- std::move(proxy_config_service), net_log);
-}
-
} // namespace net
« no previous file with comments | « net/url_request/url_request_context_builder.h ('k') | net/url_request/url_request_context_builder_v8.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698