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

Unified Diff: chrome/browser/profiles/profile_io_data.cc

Issue 7282054: Remove more unnecessary ChromeURLRequestContext members. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix copyright and chormeos tests. Created 9 years, 5 months 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
Index: chrome/browser/profiles/profile_io_data.cc
diff --git a/chrome/browser/profiles/profile_io_data.cc b/chrome/browser/profiles/profile_io_data.cc
index 01e7bd50aa463c6cec0d6c4b110763eefd6bd60f..63f0499242a904877cb324f8179ad50f3a14c9db 100644
--- a/chrome/browser/profiles/profile_io_data.cc
+++ b/chrome/browser/profiles/profile_io_data.cc
@@ -12,9 +12,11 @@
#include "base/logging.h"
#include "base/stl_util-inl.h"
#include "base/string_number_conversions.h"
+#include "base/task.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/content_settings/host_content_settings_map.h"
#include "chrome/browser/custom_handlers/protocol_handler_registry.h"
+#include "chrome/browser/extensions/extension_info_map.h"
#include "chrome/browser/extensions/extension_protocols.h"
#include "chrome/browser/io_thread.h"
#include "chrome/browser/media/media_internals.h"
@@ -33,7 +35,9 @@
#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
+#include "content/browser/appcache/chrome_appcache_service.h"
#include "content/browser/browser_thread.h"
+#include "content/browser/chrome_blob_storage_context.h"
#include "content/browser/host_zoom_map.h"
#include "content/browser/renderer_host/resource_dispatcher_host.h"
#include "content/browser/renderer_host/resource_dispatcher_host_request_info.h"
@@ -47,6 +51,7 @@
#include "net/url_request/url_request.h"
#include "webkit/blob/blob_data.h"
#include "webkit/blob/blob_url_request_job_factory.h"
+#include "webkit/fileapi/file_system_context.h"
#include "webkit/fileapi/file_system_url_request_job_factory.h"
#include "webkit/database/database_tracker.h"
#include "webkit/quota/quota_manager.h"
@@ -303,13 +308,7 @@ ProfileIOData::ProfileIOData(bool is_incognito)
}
ProfileIOData::~ProfileIOData() {
- // If we have never initialized ProfileIOData, then Handle may hold the only
- // reference to it. The important thing is to make sure it hasn't been
- // initialized yet, because the lazily initialized variables are supposed to
- // live on the IO thread.
- if (BrowserThread::CurrentlyOn(BrowserThread::UI))
- DCHECK(!initialized_);
- else
+ if (BrowserThread::IsMessageLoopValid(BrowserThread::IO))
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
}
@@ -342,6 +341,16 @@ bool ProfileIOData::IsHandledURL(const GURL& url) {
return IsHandledProtocol(url.scheme());
}
+const content::ResourceContext& ProfileIOData::GetResourceContext() const {
+ return resource_context_;
+}
+
+ChromeURLDataManagerBackend*
+ProfileIOData::GetChromeURLDataManagerBackend() const {
+ LazyInitialize();
+ return chrome_url_data_manager_backend_.get();
+}
+
scoped_refptr<ChromeURLRequestContext>
ProfileIOData::GetMainRequestContext() const {
LazyInitialize();
@@ -389,10 +398,6 @@ ProfileIOData::GetIsolatedAppRequestContext(
return context;
}
-const content::ResourceContext& ProfileIOData::GetResourceContext() const {
- return resource_context_;
-}
-
ExtensionInfoMap* ProfileIOData::GetExtensionInfoMap() const {
return extension_info_map_;
}
@@ -469,7 +474,8 @@ void ProfileIOData::LazyInitialize() const {
chrome::kChromeUIScheme,
ChromeURLDataManagerBackend::CreateProtocolHandler(
chrome_url_data_manager_backend_.get(),
- profile_params_->appcache_service));
+ profile_params_->appcache_service,
+ profile_params_->blob_storage_context->controller()));
DCHECK(set_protocol);
set_protocol = job_factory_->SetProtocolHandler(
chrome::kChromeDevToolsScheme,
@@ -535,10 +541,6 @@ void ProfileIOData::ApplyProfileParamsToContext(
context->set_transport_security_state(
profile_params_->transport_security_state);
context->set_ssl_config_service(profile_params_->ssl_config_service);
- context->set_appcache_service(profile_params_->appcache_service);
- context->set_blob_storage_context(profile_params_->blob_storage_context);
- context->set_file_system_context(profile_params_->file_system_context);
- context->set_extension_info_map(profile_params_->extension_info_map);
}
void ProfileIOData::ShutdownOnUIThread() {
@@ -546,4 +548,8 @@ void ProfileIOData::ShutdownOnUIThread() {
enable_referrers_.Destroy();
clear_local_state_on_exit_.Destroy();
safe_browsing_enabled_.Destroy();
+ bool posted = BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
+ new ReleaseTask<ProfileIOData>(this));
+ if (!posted)
+ Release();
}

Powered by Google App Engine
This is Rietveld 408576698