summaryrefslogtreecommitdiffstats
path: root/chrome/browser/profiles/profile_io_data.cc
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 /chrome/browser/profiles/profile_io_data.cc
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 'chrome/browser/profiles/profile_io_data.cc')
-rw-r--r--chrome/browser/profiles/profile_io_data.cc38
1 files changed, 10 insertions, 28 deletions
diff --git a/chrome/browser/profiles/profile_io_data.cc b/chrome/browser/profiles/profile_io_data.cc
index 969560b..31a9e1a 100644
--- a/chrome/browser/profiles/profile_io_data.cc
+++ b/chrome/browser/profiles/profile_io_data.cc
@@ -249,15 +249,8 @@ void ProfileIOData::InitializeProfileParams(Profile* profile) {
profile_params_.reset(params.release());
}
-ProfileIOData::RequestContext::RequestContext() {}
-ProfileIOData::RequestContext::~RequestContext() {}
-
-ProfileIOData::AppRequestContext::AppRequestContext(const std::string& app_id)
- : app_id_(app_id) {}
-ProfileIOData::AppRequestContext::~AppRequestContext() {
- DCHECK(ContainsKey(profile_io_data()->app_request_context_map_, app_id_));
- profile_io_data()->app_request_context_map_.erase(app_id_);
-}
+ProfileIOData::AppRequestContext::AppRequestContext() {}
+ProfileIOData::AppRequestContext::~AppRequestContext() {}
void ProfileIOData::AppRequestContext::SetCookieStore(
net::CookieStore* cookie_store) {
@@ -332,10 +325,7 @@ ProfileIOData::GetChromeURLDataManagerBackend() const {
scoped_refptr<ChromeURLRequestContext>
ProfileIOData::GetMainRequestContext() const {
LazyInitialize();
- scoped_refptr<RequestContext> context = main_request_context_;
- context->set_profile_io_data(const_cast<ProfileIOData*>(this));
- main_request_context_ = NULL;
- return context;
+ return main_request_context_;
}
scoped_refptr<ChromeURLRequestContext>
@@ -350,11 +340,7 @@ ProfileIOData::GetMediaRequestContext() const {
scoped_refptr<ChromeURLRequestContext>
ProfileIOData::GetExtensionsRequestContext() const {
LazyInitialize();
- scoped_refptr<RequestContext> context =
- extensions_request_context_;
- context->set_profile_io_data(const_cast<ProfileIOData*>(this));
- extensions_request_context_ = NULL;
- return context;
+ return extensions_request_context_;
}
scoped_refptr<ChromeURLRequestContext>
@@ -366,11 +352,8 @@ ProfileIOData::GetIsolatedAppRequestContext(
if (ContainsKey(app_request_context_map_, app_id)) {
context = app_request_context_map_[app_id];
} else {
- scoped_refptr<RequestContext> request_context =
- AcquireIsolatedAppRequestContext(main_context, app_id);
- request_context->set_profile_io_data(const_cast<ProfileIOData*>(this));
- app_request_context_map_[app_id] = request_context;
- context = request_context;
+ context = AcquireIsolatedAppRequestContext(main_context, app_id);
+ app_request_context_map_[app_id] = context;
}
DCHECK(context);
return context;
@@ -410,9 +393,8 @@ void ProfileIOData::LazyInitialize() const {
const CommandLine& command_line = *CommandLine::ForCurrentProcess();
// Create the common request contexts.
- main_request_context_ = new RequestContext;
- extensions_request_context_ = new RequestContext;
- weak_extensions_request_context_ = extensions_request_context_->GetWeakPtr();
+ main_request_context_ = new ChromeURLRequestContext;
+ extensions_request_context_ = new ChromeURLRequestContext;
profile_params_->appcache_service->set_request_context(main_request_context_);
@@ -533,7 +515,7 @@ void ProfileIOData::ShutdownOnUIThread() {
base::Unretained(g_browser_process->resource_dispatcher_host()),
&resource_context_));
bool posted = BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
- new ReleaseTask<ProfileIOData>(this));
+ new DeleteTask<ProfileIOData>(this));
if (!posted)
- Release();
+ delete this;
}