summaryrefslogtreecommitdiffstats
path: root/net/url_request
diff options
context:
space:
mode:
authorwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-29 16:41:28 +0000
committerwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-29 16:41:28 +0000
commit18590f24c69ded8500cf6970b4071654cdb22db4 (patch)
tree586d5840d97998ec4fe98d9192ef7c8504e3057b /net/url_request
parentcfea39e639180ae6b96403c0a80546a6109ba62b (diff)
downloadchromium_src-18590f24c69ded8500cf6970b4071654cdb22db4.zip
chromium_src-18590f24c69ded8500cf6970b4071654cdb22db4.tar.gz
chromium_src-18590f24c69ded8500cf6970b4071654cdb22db4.tar.bz2
Reland r94047 - Make Profile own ProfileIOData.
Unfortunately some URLFetchers were still alive. We have to kill them all before we kill the Profiles. BUG=64339 TEST=none Review URL: http://codereview.chromium.org/7533014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@94687 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/url_request')
-rw-r--r--net/url_request/url_request_context.cc4
-rw-r--r--net/url_request/url_request_context.h7
2 files changed, 10 insertions, 1 deletions
diff --git a/net/url_request/url_request_context.cc b/net/url_request/url_request_context.cc
index 2349a23..e808a0e 100644
--- a/net/url_request/url_request_context.cc
+++ b/net/url_request/url_request_context.cc
@@ -4,6 +4,7 @@
#include "net/url_request/url_request_context.h"
+#include "base/compiler_specific.h"
#include "base/string_util.h"
#include "net/base/cookie_store.h"
#include "net/base/host_resolver.h"
@@ -13,7 +14,8 @@
namespace net {
URLRequestContext::URLRequestContext()
- : net_log_(NULL),
+ : ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)),
+ net_log_(NULL),
host_resolver_(NULL),
cert_verifier_(NULL),
origin_bound_cert_service_(NULL),
diff --git a/net/url_request/url_request_context.h b/net/url_request/url_request_context.h
index d64db3d..0d55a30 100644
--- a/net/url_request/url_request_context.h
+++ b/net/url_request/url_request_context.h
@@ -13,6 +13,7 @@
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
+#include "base/memory/weak_ptr.h"
#include "base/threading/non_thread_safe.h"
#include "net/base/net_api.h"
#include "net/base/net_log.h"
@@ -45,6 +46,10 @@ class NET_API URLRequestContext
public:
URLRequestContext();
+ base::WeakPtr<URLRequestContext> GetWeakPtr() {
+ return weak_factory_.GetWeakPtr();
+ }
+
// Copies the state from |other| into this context.
void CopyFrom(URLRequestContext* other);
@@ -188,6 +193,8 @@ class NET_API URLRequestContext
virtual ~URLRequestContext();
private:
+ base::WeakPtrFactory<URLRequestContext> weak_factory_;
+
// ---------------------------------------------------------------------------
// Important: When adding any new members below, consider whether they need to
// be added to CopyFrom.