Set proxy service at the right place.

This commit is contained in:
Cheng Zhao 2013-09-29 21:43:17 +08:00
parent b50a2c9dc1
commit 709563c090

View file

@ -84,8 +84,17 @@ net::URLRequestContext* AtomURLRequestContextGetter::GetURLRequestContext() {
scoped_ptr<net::HostResolver> host_resolver( scoped_ptr<net::HostResolver> host_resolver(
net::HostResolver::CreateDefaultResolver(NULL)); net::HostResolver::CreateDefaultResolver(NULL));
net::DhcpProxyScriptFetcherFactory dhcp_factory;
storage_->set_cert_verifier(net::CertVerifier::CreateDefault()); storage_->set_cert_verifier(net::CertVerifier::CreateDefault());
storage_->set_proxy_service(
net::CreateProxyServiceUsingV8ProxyResolver(
proxy_config_service_.release(),
new net::ProxyScriptFetcherImpl(url_request_context_.get()),
dhcp_factory.Create(url_request_context_.get()),
host_resolver.get(),
NULL,
url_request_context_->network_delegate()));
storage_->set_ssl_config_service(new net::SSLConfigServiceDefaults); storage_->set_ssl_config_service(new net::SSLConfigServiceDefaults);
storage_->set_http_auth_handler_factory( storage_->set_http_auth_handler_factory(
net::HttpAuthHandlerFactory::CreateDefault(host_resolver.get())); net::HttpAuthHandlerFactory::CreateDefault(host_resolver.get()));
@ -122,16 +131,6 @@ net::URLRequestContext* AtomURLRequestContextGetter::GetURLRequestContext() {
network_session_params.host_resolver = network_session_params.host_resolver =
url_request_context_->host_resolver(); url_request_context_->host_resolver();
net::DhcpProxyScriptFetcherFactory dhcp_factory;
storage_->set_proxy_service(
net::CreateProxyServiceUsingV8ProxyResolver(
proxy_config_service_.release(),
new net::ProxyScriptFetcherImpl(url_request_context_.get()),
dhcp_factory.Create(url_request_context_.get()),
url_request_context_->host_resolver(),
NULL,
url_request_context_->network_delegate()));
net::HttpCache* main_cache = new net::HttpCache( net::HttpCache* main_cache = new net::HttpCache(
network_session_params, main_backend); network_session_params, main_backend);
storage_->set_http_transaction_factory(main_cache); storage_->set_http_transaction_factory(main_cache);