diff options
author | eroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-19 03:43:19 +0000 |
---|---|---|
committer | eroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-19 03:43:19 +0000 |
commit | 13c30929c4c0daaf891554ddb52ebebb80a36afa (patch) | |
tree | 919dc81ccd716828c8a09edca0d68531b9e4b27b /chrome/browser/profile.cc | |
parent | 5fc341a9731fd518bbe6314a3eec3ebc98109de7 (diff) | |
download | chromium_src-13c30929c4c0daaf891554ddb52ebebb80a36afa.zip chromium_src-13c30929c4c0daaf891554ddb52ebebb80a36afa.tar.gz chromium_src-13c30929c4c0daaf891554ddb52ebebb80a36afa.tar.bz2 |
Cleanup some callers now that the restriction that ChromeURLRequestContextGetter be released from the IO thread is gone.
This was an anoyance for consumers of URLRequestContextGetter, as they would play tricks doing manual AddRef/Release.
The actual removal of this policy happened in: r32129.
BUG=None
Test=Existing tests don't crash/leak.
Review URL: http://codereview.chromium.org/332006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32488 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/profile.cc')
-rw-r--r-- | chrome/browser/profile.cc | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/chrome/browser/profile.cc b/chrome/browser/profile.cc index 32e3306..c1cd54d 100644 --- a/chrome/browser/profile.cc +++ b/chrome/browser/profile.cc @@ -129,12 +129,8 @@ bool HasACacheSubdir(const FilePath &dir) { URLRequestContextGetter* Profile::default_request_context_; static void CleanupRequestContext(ChromeURLRequestContextGetter* context) { - if (context) { + if (context) context->CleanupOnUIThread(); - - // Clean up request context on IO thread. - ChromeThread::ReleaseSoon(ChromeThread::IO, FROM_HERE, context); - } } // static @@ -200,7 +196,6 @@ class OffTheRecordProfileImpl : public Profile, extensions_request_context_(NULL), start_time_(Time::Now()) { request_context_ = ChromeURLRequestContextGetter::CreateOffTheRecord(this); - request_context_->AddRef(); // Register for browser close notifications so we can detect when the last // off-the-record window is closed, in which case we can clean our states @@ -400,7 +395,6 @@ class OffTheRecordProfileImpl : public Profile, if (!extensions_request_context_) { extensions_request_context_ = ChromeURLRequestContextGetter::CreateOffTheRecordForExtensions(this); - extensions_request_context_->AddRef(); } return extensions_request_context_; @@ -549,9 +543,9 @@ class OffTheRecordProfileImpl : public Profile, Profile* profile_; // The context to use for requests made from this OTR session. - ChromeURLRequestContextGetter* request_context_; + scoped_refptr<ChromeURLRequestContextGetter> request_context_; - ChromeURLRequestContextGetter* extensions_request_context_; + scoped_refptr<ChromeURLRequestContextGetter> extensions_request_context_; // The download manager that only stores downloaded items in memory. scoped_refptr<DownloadManager> download_manager_; @@ -938,7 +932,6 @@ URLRequestContextGetter* ProfileImpl::GetRequestContext() { cache_path = GetCachePath(cache_path); request_context_ = ChromeURLRequestContextGetter::CreateOriginal( this, cookie_path, cache_path, max_size); - request_context_->AddRef(); // The first request context is always a normal (non-OTR) request context. // Even when Chromium is started in OTR mode, a normal profile is always @@ -966,7 +959,6 @@ URLRequestContextGetter* ProfileImpl::GetRequestContextForMedia() { media_request_context_ = ChromeURLRequestContextGetter::CreateOriginalForMedia( this, cache_path, max_size); - media_request_context_->AddRef(); } return media_request_context_; @@ -989,7 +981,6 @@ URLRequestContextGetter* ProfileImpl::GetRequestContextForExtensions() { extensions_request_context_ = ChromeURLRequestContextGetter::CreateOriginalForExtensions( this, cookie_path); - extensions_request_context_->AddRef(); } return extensions_request_context_; |