From 80d6524d33061e0e4f7b06dd87ee94de3e05c7a8 Mon Sep 17 00:00:00 2001 From: "eroman@chromium.org" Date: Tue, 18 Aug 2009 03:58:09 +0000 Subject: Reference count ProxyService. This is necessary since ProxyService is getting shared between chrome's url request contexts (off the record, media), and the current way it is being shared could result in free memory read/writes during shutdown. This is a step towards fixing http://crbug.com/15289. BUG=http://crbug.com/15289 TEST=The existing tests should continue to pass following this refactor. Review URL: http://codereview.chromium.org/165430 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23612 0039d316-1c4b-4281-b951-d872f2087c98 --- net/url_request/url_request_context.h | 8 +++----- net/url_request/url_request_unittest.cc | 1 - net/url_request/url_request_unittest.h | 1 - 3 files changed, 3 insertions(+), 7 deletions(-) (limited to 'net/url_request') diff --git a/net/url_request/url_request_context.h b/net/url_request/url_request_context.h index 63ab217..aac651a 100644 --- a/net/url_request/url_request_context.h +++ b/net/url_request/url_request_context.h @@ -16,12 +16,12 @@ #include "net/base/cookie_store.h" #include "net/base/host_resolver.h" #include "net/ftp/ftp_auth_cache.h" +#include "net/proxy/proxy_service.h" namespace net { class ForceTLSState; class FtpTransactionFactory; class HttpTransactionFactory; -class ProxyService; } class URLRequest; @@ -30,9 +30,7 @@ class URLRequestContext : public base::RefCountedThreadSafe { public: URLRequestContext() - : host_resolver_(NULL), - proxy_service_(NULL), - http_transaction_factory_(NULL), + : http_transaction_factory_(NULL), ftp_transaction_factory_(NULL), cookie_store_(NULL), force_tls_state_(NULL) { @@ -109,7 +107,7 @@ class URLRequestContext : // The following members are expected to be initialized and owned by // subclasses. scoped_refptr host_resolver_; - net::ProxyService* proxy_service_; + scoped_refptr proxy_service_; net::HttpTransactionFactory* http_transaction_factory_; net::FtpTransactionFactory* ftp_transaction_factory_; net::CookieStore* cookie_store_; diff --git a/net/url_request/url_request_unittest.cc b/net/url_request/url_request_unittest.cc index 6c003bf..7a56d29 100644 --- a/net/url_request/url_request_unittest.cc +++ b/net/url_request/url_request_unittest.cc @@ -62,7 +62,6 @@ class URLRequestTestContext : public URLRequestContext { delete cookie_store_; delete ftp_transaction_factory_; delete http_transaction_factory_; - delete proxy_service_; } }; diff --git a/net/url_request/url_request_unittest.h b/net/url_request/url_request_unittest.h index 24714ce..22e9b99 100644 --- a/net/url_request/url_request_unittest.h +++ b/net/url_request/url_request_unittest.h @@ -62,7 +62,6 @@ class TestURLRequestContext : public URLRequestContext { virtual ~TestURLRequestContext() { delete http_transaction_factory_; - delete proxy_service_; } }; -- cgit v1.1