summaryrefslogtreecommitdiffstats
path: root/net/url_request
diff options
context:
space:
mode:
authoreroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-18 03:58:09 +0000
committereroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-18 03:58:09 +0000
commit80d6524d33061e0e4f7b06dd87ee94de3e05c7a8 (patch)
tree05719af6d66e6a107aeb056a020645ae0f483e82 /net/url_request
parent22cdd93852c8f0782cb86b066cfcd95a9121912b (diff)
downloadchromium_src-80d6524d33061e0e4f7b06dd87ee94de3e05c7a8.zip
chromium_src-80d6524d33061e0e4f7b06dd87ee94de3e05c7a8.tar.gz
chromium_src-80d6524d33061e0e4f7b06dd87ee94de3e05c7a8.tar.bz2
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
Diffstat (limited to 'net/url_request')
-rw-r--r--net/url_request/url_request_context.h8
-rw-r--r--net/url_request/url_request_unittest.cc1
-rw-r--r--net/url_request/url_request_unittest.h1
3 files changed, 3 insertions, 7 deletions
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<URLRequestContext> {
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<net::HostResolver> host_resolver_;
- net::ProxyService* proxy_service_;
+ scoped_refptr<net::ProxyService> 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_;
}
};