summaryrefslogtreecommitdiffstats
path: root/net/proxy/proxy_service.h
diff options
context:
space:
mode:
authorericroman@google.com <ericroman@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-13 03:44:24 +0000
committerericroman@google.com <ericroman@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-13 03:44:24 +0000
commitd49801990067e7fe9a3caf141f31c6e6ba58fcfc (patch)
tree502fef7a064f7e1b67291d418b897117e2427822 /net/proxy/proxy_service.h
parent96508147cf0947fdd4ae19d9ee7f5f2e13268a5f (diff)
downloadchromium_src-d49801990067e7fe9a3caf141f31c6e6ba58fcfc.zip
chromium_src-d49801990067e7fe9a3caf141f31c6e6ba58fcfc.tar.gz
chromium_src-d49801990067e7fe9a3caf141f31c6e6ba58fcfc.tar.bz2
Use automatic memory management for URLRequestContext's members.
Also make ProxyService refcounted so the sharing between profiles is explicit. Review URL: http://codereview.chromium.org/13701 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6966 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/proxy/proxy_service.h')
-rw-r--r--net/proxy/proxy_service.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/net/proxy/proxy_service.h b/net/proxy/proxy_service.h
index bea4aef..6ab6a1b 100644
--- a/net/proxy/proxy_service.h
+++ b/net/proxy/proxy_service.h
@@ -83,7 +83,7 @@ typedef std::map<std::string, ProxyRetryInfo> ProxyRetryInfoMap;
// This class can be used to resolve the proxy server to use when loading a
// HTTP(S) URL. It uses the given ProxyResolver to handle the actual proxy
// resolution. See ProxyResolverWinHttp for example.
-class ProxyService {
+class ProxyService : public base::RefCounted<ProxyService> {
public:
// The instance takes ownership of |resolver|.
explicit ProxyService(ProxyResolver* resolver);
@@ -138,6 +138,10 @@ class ProxyService {
// use IE's settings).
static ProxyService* Create(const ProxyInfo* pi);
+ // Create a ProxyService which fails every request, causing fallback to a
+ // direct connection. Convenience function used by unit tests.
+ static ProxyService* CreateNull();
+
// TODO(eroman): remove once WinHTTP is gone.
// Get the ProxyInfo used to create this proxy service (only used by WinHTTP).
const ProxyInfo* proxy_info() const {