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

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

Issue 6825038: Create a content::ResourceContext. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix dependencies. Created 9 years, 8 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/off_the_record_profile_io_data.cc
diff --git a/chrome/browser/profiles/off_the_record_profile_io_data.cc b/chrome/browser/profiles/off_the_record_profile_io_data.cc
index dc2c66666d9fd0b74ab66d6cfed50013645bd675..d46d127f2d02f6c1044bcee8bb609899f660f10f 100644
--- a/chrome/browser/profiles/off_the_record_profile_io_data.cc
+++ b/chrome/browser/profiles/off_the_record_profile_io_data.cc
@@ -19,8 +19,10 @@
#include "chrome/common/extensions/extension.h"
#include "chrome/common/url_constants.h"
#include "content/browser/browser_thread.h"
+#include "content/browser/resource_context.h"
#include "net/ftp/ftp_network_layer.h"
#include "net/http/http_cache.h"
+#include "webkit/database/database_tracker.h"
OffTheRecordProfileIOData::Handle::Handle(Profile* profile)
: io_data_(new OffTheRecordProfileIOData),
@@ -50,6 +52,13 @@ OffTheRecordProfileIOData::Handle::~Handle() {
}
}
+const content::ResourceContext&
+OffTheRecordProfileIOData::Handle::GetResourceContext() const {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ LazyInitialize();
+ return io_data_->GetResourceContext();
+}
+
scoped_refptr<ChromeURLRequestContextGetter>
OffTheRecordProfileIOData::Handle::GetMainRequestContextGetter() const {
// TODO(oshima): Re-enable when ChromeOS only accesses the profile on the UI
@@ -100,7 +109,7 @@ OffTheRecordProfileIOData::Handle::GetIsolatedAppRequestContextGetter(
void OffTheRecordProfileIOData::Handle::LazyInitialize() const {
if (!initialized_) {
- InitializeProfileParams(profile_, &io_data_->lazy_params_->profile_params);
+ io_data_->InitializeProfileParams(profile_);
initialized_ = true;
}
}
@@ -115,21 +124,21 @@ OffTheRecordProfileIOData::~OffTheRecordProfileIOData() {
STLDeleteValues(&app_http_factory_map_);
}
-void OffTheRecordProfileIOData::LazyInitializeInternal() const {
+void OffTheRecordProfileIOData::LazyInitializeInternal(
+ ProfileParams* profile_params) const {
main_request_context_ = new RequestContext;
extensions_request_context_ = new RequestContext;
IOThread* const io_thread = lazy_params_->io_thread;
IOThread::Globals* const io_thread_globals = io_thread->globals();
- const ProfileParams& profile_params = lazy_params_->profile_params;
const CommandLine& command_line = *CommandLine::ForCurrentProcess();
- ApplyProfileParamsToContext(profile_params, main_request_context_);
- ApplyProfileParamsToContext(profile_params, extensions_request_context_);
- profile_params.appcache_service->set_request_context(main_request_context_);
+ ApplyProfileParamsToContext(main_request_context_);
+ ApplyProfileParamsToContext(extensions_request_context_);
+ profile_params->appcache_service->set_request_context(main_request_context_);
cookie_policy_.reset(
- new ChromeCookiePolicy(profile_params.host_content_settings_map));
+ new ChromeCookiePolicy(profile_params->host_content_settings_map));
main_request_context_->set_cookie_policy(cookie_policy_.get());
extensions_request_context_->set_cookie_policy(cookie_policy_.get());
@@ -138,8 +147,8 @@ void OffTheRecordProfileIOData::LazyInitializeInternal() const {
network_delegate_.reset(new ChromeNetworkDelegate(
io_thread_globals->extension_event_router_forwarder.get(),
- profile_params.profile_id,
- profile_params.protocol_handler_registry));
+ profile_params->profile_id,
+ profile_params->protocol_handler_registry));
main_request_context_->set_network_delegate(network_delegate_.get());
main_request_context_->set_host_resolver(
@@ -160,11 +169,11 @@ void OffTheRecordProfileIOData::LazyInitializeInternal() const {
ProxyServiceFactory::CreateProxyService(
io_thread->net_log(),
io_thread_globals->proxy_script_fetcher_context.get(),
- lazy_params_->profile_params.proxy_config_service.release(),
+ profile_params->proxy_config_service.release(),
command_line));
main_request_context_->set_cookie_store(
- new net::CookieMonster(NULL, profile_params.cookie_monster_delegate));
+ new net::CookieMonster(NULL, profile_params->cookie_monster_delegate));
// All we care about for extensions is the cookie store. For incognito, we
// use a non-persistent cookie store.

Powered by Google App Engine
This is Rietveld 408576698