| 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 af07f6b4fcbc56f45e75d7edb8c526615b7fd3e1..aa911128a48d67805efd214e77f3d4871974cdbb 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),
|
| @@ -52,6 +54,13 @@ OffTheRecordProfileIOData::Handle::~Handle() {
|
| io_data_->ShutdownOnUIThread();
|
| }
|
|
|
| +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
|
| @@ -102,7 +111,7 @@ OffTheRecordProfileIOData::Handle::GetIsolatedAppRequestContextGetter(
|
|
|
| void OffTheRecordProfileIOData::Handle::LazyInitialize() const {
|
| if (!initialized_) {
|
| - InitializeProfileParams(profile_, &io_data_->lazy_params_->profile_params);
|
| + io_data_->InitializeProfileParams(profile_);
|
| ChromeNetworkDelegate::InitializeReferrersEnabled(
|
| io_data_->enable_referrers(), profile_->GetPrefs());
|
| initialized_ = true;
|
| @@ -119,21 +128,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());
|
|
|
| @@ -142,9 +151,9 @@ void OffTheRecordProfileIOData::LazyInitializeInternal() const {
|
|
|
| network_delegate_.reset(new ChromeNetworkDelegate(
|
| io_thread_globals->extension_event_router_forwarder.get(),
|
| - profile_params.profile_id,
|
| + profile_params->profile_id,
|
| enable_referrers(),
|
| - profile_params.protocol_handler_registry));
|
| + profile_params->protocol_handler_registry));
|
| main_request_context_->set_network_delegate(network_delegate_.get());
|
|
|
| main_request_context_->set_host_resolver(
|
| @@ -165,11 +174,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.
|
|
|
|
|