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

Unified Diff: chrome/browser/profile.cc

Issue 332006: Remove the restriction that ChromeURLRequestContextGetter needs to be release... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: sync to latest changes Created 11 years, 1 month 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 | « chrome/browser/profile.h ('k') | chrome/browser/sync/glue/http_bridge.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/profile.cc
===================================================================
--- chrome/browser/profile.cc (revision 32405)
+++ chrome/browser/profile.cc (working copy)
@@ -129,12 +129,8 @@
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 @@
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 @@
if (!extensions_request_context_) {
extensions_request_context_ =
ChromeURLRequestContextGetter::CreateOffTheRecordForExtensions(this);
- extensions_request_context_->AddRef();
}
return extensions_request_context_;
@@ -549,9 +543,9 @@
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 @@
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 @@
media_request_context_ =
ChromeURLRequestContextGetter::CreateOriginalForMedia(
this, cache_path, max_size);
- media_request_context_->AddRef();
}
return media_request_context_;
@@ -989,7 +981,6 @@
extensions_request_context_ =
ChromeURLRequestContextGetter::CreateOriginalForExtensions(
this, cookie_path);
- extensions_request_context_->AddRef();
}
return extensions_request_context_;
« no previous file with comments | « chrome/browser/profile.h ('k') | chrome/browser/sync/glue/http_bridge.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698