diff options
author | ericroman@google.com <ericroman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-13 03:44:24 +0000 |
---|---|---|
committer | ericroman@google.com <ericroman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-13 03:44:24 +0000 |
commit | d49801990067e7fe9a3caf141f31c6e6ba58fcfc (patch) | |
tree | 502fef7a064f7e1b67291d418b897117e2427822 /net/url_request/url_request_context.h | |
parent | 96508147cf0947fdd4ae19d9ee7f5f2e13268a5f (diff) | |
download | chromium_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/url_request/url_request_context.h')
-rw-r--r-- | net/url_request/url_request_context.h | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/net/url_request/url_request_context.h b/net/url_request/url_request_context.h index 5ea25db..7b7d392 100644 --- a/net/url_request/url_request_context.h +++ b/net/url_request/url_request_context.h @@ -28,13 +28,8 @@ class ProxyService; class URLRequestContext : public base::RefCountedThreadSafe<URLRequestContext> { public: - URLRequestContext() - : proxy_service_(NULL), - http_transaction_factory_(NULL), - cookie_store_(NULL), - is_off_the_record_(false) { - } - + URLRequestContext(); + // Get the proxy service for this context. net::ProxyService* proxy_service() const { return proxy_service_; @@ -42,11 +37,11 @@ class URLRequestContext : // Gets the http transaction factory for this context. net::HttpTransactionFactory* http_transaction_factory() { - return http_transaction_factory_; + return http_transaction_factory_.get(); } // Gets the cookie store for this context. - net::CookieMonster* cookie_store() { return cookie_store_; } + net::CookieMonster* cookie_store() { return cookie_store_.get(); } // Gets the cookie policy for this context. net::CookiePolicy* cookie_policy() { return &cookie_policy_; } @@ -68,14 +63,13 @@ class URLRequestContext : // Do not call this directly. TODO(darin): extending from RefCounted* should // not require a public destructor! - virtual ~URLRequestContext() {} + virtual ~URLRequestContext(); protected: - // The following members are expected to be initialized and owned by - // subclasses. - net::ProxyService* proxy_service_; - net::HttpTransactionFactory* http_transaction_factory_; - net::CookieMonster* cookie_store_; + // The following members are expected to be initialized by subclasses. + scoped_refptr<net::ProxyService> proxy_service_; + scoped_ptr<net::HttpTransactionFactory> http_transaction_factory_; + scoped_ptr<net::CookieMonster> cookie_store_; net::CookiePolicy cookie_policy_; net::AuthCache ftp_auth_cache_; std::string user_agent_; |