summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-24 07:30:01 +0000
committerwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-24 07:30:01 +0000
commit52617df3c0d6b2f57763d52dd3c24dab32154d61 (patch)
treecc40dfe01feea9eaf8471259538761de59ab46f8 /chrome/browser
parenta95986a837fc86e079b5c6dac357636478b50092 (diff)
downloadchromium_src-52617df3c0d6b2f57763d52dd3c24dab32154d61.zip
chromium_src-52617df3c0d6b2f57763d52dd3c24dab32154d61.tar.gz
chromium_src-52617df3c0d6b2f57763d52dd3c24dab32154d61.tar.bz2
Don't leak proxy script fetcher's http transaction factories.
BUG=none TEST=none Review URL: http://codereview.chromium.org/6012008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70140 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/io_thread.cc28
-rw-r--r--chrome/browser/io_thread.h3
-rw-r--r--chrome/browser/net/connection_tester_unittest.cc4
3 files changed, 21 insertions, 14 deletions
diff --git a/chrome/browser/io_thread.cc b/chrome/browser/io_thread.cc
index e337ba5..f20c8a6 100644
--- a/chrome/browser/io_thread.cc
+++ b/chrome/browser/io_thread.cc
@@ -189,19 +189,7 @@ ConstructProxyScriptFetcherContext(IOThread::Globals* globals,
globals->http_auth_handler_factory.get());
context->set_proxy_service(globals->proxy_script_fetcher_proxy_service.get());
context->set_http_transaction_factory(
- new net::HttpNetworkLayer(
- globals->client_socket_factory,
- globals->host_resolver.get(),
- globals->cert_verifier.get(),
- globals->dnsrr_resolver.get(),
- NULL /* dns_cert_checker */,
- NULL /* ssl_host_info_factory */,
- globals->proxy_script_fetcher_proxy_service.get(),
- globals->ssl_config_service.get(),
- new net::SpdySessionPool(globals->ssl_config_service.get()),
- globals->http_auth_handler_factory.get(),
- &globals->network_delegate,
- net_log));
+ globals->proxy_script_fetcher_http_transaction_factory.get());
// In-memory cookie store.
context->set_cookie_store(new net::CookieMonster(NULL, NULL));
return context;
@@ -345,6 +333,20 @@ void IOThread::Init() {
// For the ProxyScriptFetcher, we use a direct ProxyService.
globals_->proxy_script_fetcher_proxy_service =
net::ProxyService::CreateDirectWithNetLog(net_log_);
+ globals_->proxy_script_fetcher_http_transaction_factory.reset(
+ new net::HttpNetworkLayer(
+ globals_->client_socket_factory,
+ globals_->host_resolver.get(),
+ globals_->cert_verifier.get(),
+ globals_->dnsrr_resolver.get(),
+ NULL /* dns_cert_checker */,
+ NULL /* ssl_host_info_factory */,
+ globals_->proxy_script_fetcher_proxy_service.get(),
+ globals_->ssl_config_service.get(),
+ new net::SpdySessionPool(globals_->ssl_config_service.get()),
+ globals_->http_auth_handler_factory.get(),
+ &globals_->network_delegate,
+ net_log_));
scoped_refptr<URLRequestContext> proxy_script_fetcher_context =
ConstructProxyScriptFetcherContext(globals_, net_log_);
diff --git a/chrome/browser/io_thread.h b/chrome/browser/io_thread.h
index 8e52ca0..2f47a42 100644
--- a/chrome/browser/io_thread.h
+++ b/chrome/browser/io_thread.h
@@ -34,6 +34,7 @@ class ClientSocketFactory;
class DnsRRResolver;
class HostResolver;
class HttpAuthHandlerFactory;
+class HttpTransactionFactory;
class ProxyScriptFetcher;
class ProxyService;
class SSLConfigService;
@@ -53,6 +54,8 @@ class IOThread : public BrowserProcessSubThread {
scoped_refptr<net::SSLConfigService> ssl_config_service;
scoped_ptr<net::HttpAuthHandlerFactory> http_auth_handler_factory;
scoped_refptr<net::ProxyService> proxy_script_fetcher_proxy_service;
+ scoped_ptr<net::HttpTransactionFactory>
+ proxy_script_fetcher_http_transaction_factory;
scoped_ptr<net::URLSecurityManager> url_security_manager;
ChromeNetworkDelegate network_delegate;
scoped_refptr<URLRequestContext> proxy_script_fetcher_context;
diff --git a/chrome/browser/net/connection_tester_unittest.cc b/chrome/browser/net/connection_tester_unittest.cc
index 0ee05d2..6735599 100644
--- a/chrome/browser/net/connection_tester_unittest.cc
+++ b/chrome/browser/net/connection_tester_unittest.cc
@@ -117,7 +117,7 @@ class ConnectionTesterTest : public PlatformTest {
proxy_service_ = net::ProxyService::CreateDirect();
proxy_script_fetcher_context_->set_proxy_service(proxy_service_);
ssl_config_service_ = net::SSLConfigService::CreateSystemSSLConfigService();
- proxy_script_fetcher_context_->set_http_transaction_factory(
+ http_transaction_factory_.reset(
new net::HttpNetworkLayer(
client_socket_factory_,
&host_resolver_,
@@ -131,6 +131,8 @@ class ConnectionTesterTest : public PlatformTest {
&http_auth_handler_factory_,
NULL /* NetworkDelegate */,
NULL /* NetLog */));
+ proxy_script_fetcher_context_->set_http_transaction_factory(
+ http_transaction_factory_.get());
// In-memory cookie store.
proxy_script_fetcher_context_->set_cookie_store(
new net::CookieMonster(NULL, NULL));