From b1dc139e4bcf912f1f448a42d2d5e3e42fc0fc1d Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sun, 15 Dec 2013 15:00:52 +0800 Subject: [PATCH] Set the proxy service a bit earlier to avoid crash. --- .../browser/url_request_context_getter.cc | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/brightray/browser/url_request_context_getter.cc b/brightray/browser/url_request_context_getter.cc index e1df64c23fe8..b5596b8e05a9 100644 --- a/brightray/browser/url_request_context_getter.cc +++ b/brightray/browser/url_request_context_getter.cc @@ -86,6 +86,16 @@ net::URLRequestContext* URLRequestContextGetter::GetURLRequestContext() { scoped_ptr host_resolver( net::HostResolver::CreateDefaultResolver(NULL)); + 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()), + host_resolver.get(), + NULL, + url_request_context_->network_delegate())); + storage_->set_cert_verifier(net::CertVerifier::CreateDefault()); storage_->set_ssl_config_service(new net::SSLConfigServiceDefaults); storage_->set_http_auth_handler_factory( @@ -126,16 +136,6 @@ net::URLRequestContext* URLRequestContextGetter::GetURLRequestContext() { network_session_params.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( network_session_params, main_backend); storage_->set_http_transaction_factory(main_cache);