Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(584)

Unified Diff: net/url_request/url_request_context.h

Issue 13701: Use automatic memory management for URLRequestContext's members.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/proxy/proxy_service_unittest.cc ('k') | net/url_request/url_request_context.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_request_context.h
===================================================================
--- net/url_request/url_request_context.h (revision 6881)
+++ net/url_request/url_request_context.h (working copy)
@@ -20,21 +20,16 @@
#include "net/http/http_transaction_factory.h"
namespace net {
-class CookieMonster;
-class ProxyService;
+ class CookieMonster;
+ class ProxyService;
}
// Subclass to provide application-specific context for URLRequest instances.
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 @@
// 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 @@
// 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_;
« no previous file with comments | « net/proxy/proxy_service_unittest.cc ('k') | net/url_request/url_request_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698