diff options
Diffstat (limited to 'chrome/browser/profiles/profile_io_data.cc')
-rw-r--r-- | chrome/browser/profiles/profile_io_data.cc | 38 |
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; } |