| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/profiles/profile_impl_io_data.h" | 5 #include "chrome/browser/profiles/profile_impl_io_data.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 BrowserThread::PostTask( | 216 BrowserThread::PostTask( |
| 217 BrowserThread::IO, FROM_HERE, | 217 BrowserThread::IO, FROM_HERE, |
| 218 base::Bind( | 218 base::Bind( |
| 219 &ClearNetworkingHistorySinceOnIOThread, | 219 &ClearNetworkingHistorySinceOnIOThread, |
| 220 io_data_, | 220 io_data_, |
| 221 time)); | 221 time)); |
| 222 } | 222 } |
| 223 | 223 |
| 224 void ProfileImplIOData::Handle::LazyInitialize() const { | 224 void ProfileImplIOData::Handle::LazyInitialize() const { |
| 225 if (!initialized_) { | 225 if (!initialized_) { |
| 226 // Set initialized_ to true at the beginning in case any of the objects |
| 227 // below try to get the ResourceContext pointer. |
| 228 initialized_ = true; |
| 226 io_data_->InitializeOnUIThread(profile_); | 229 io_data_->InitializeOnUIThread(profile_); |
| 227 PrefService* pref_service = profile_->GetPrefs(); | 230 PrefService* pref_service = profile_->GetPrefs(); |
| 228 io_data_->http_server_properties_manager_.reset( | 231 io_data_->http_server_properties_manager_.reset( |
| 229 new chrome_browser_net::HttpServerPropertiesManager(pref_service)); | 232 new chrome_browser_net::HttpServerPropertiesManager(pref_service)); |
| 230 ChromeNetworkDelegate::InitializeReferrersEnabled( | 233 ChromeNetworkDelegate::InitializeReferrersEnabled( |
| 231 io_data_->enable_referrers(), pref_service); | 234 io_data_->enable_referrers(), pref_service); |
| 232 io_data_->clear_local_state_on_exit()->Init( | 235 io_data_->clear_local_state_on_exit()->Init( |
| 233 prefs::kClearSiteDataOnExit, pref_service, NULL); | 236 prefs::kClearSiteDataOnExit, pref_service, NULL); |
| 234 io_data_->clear_local_state_on_exit()->MoveToThread(BrowserThread::IO); | 237 io_data_->clear_local_state_on_exit()->MoveToThread(BrowserThread::IO); |
| 235 #if defined(ENABLE_SAFE_BROWSING) | 238 #if defined(ENABLE_SAFE_BROWSING) |
| 236 io_data_->safe_browsing_enabled()->Init(prefs::kSafeBrowsingEnabled, | 239 io_data_->safe_browsing_enabled()->Init(prefs::kSafeBrowsingEnabled, |
| 237 pref_service, NULL); | 240 pref_service, NULL); |
| 238 io_data_->safe_browsing_enabled()->MoveToThread(BrowserThread::IO); | 241 io_data_->safe_browsing_enabled()->MoveToThread(BrowserThread::IO); |
| 239 #endif | 242 #endif |
| 240 initialized_ = true; | |
| 241 } | 243 } |
| 242 } | 244 } |
| 243 | 245 |
| 244 ProfileImplIOData::LazyParams::LazyParams() | 246 ProfileImplIOData::LazyParams::LazyParams() |
| 245 : cache_max_size(0), | 247 : cache_max_size(0), |
| 246 media_cache_max_size(0) {} | 248 media_cache_max_size(0) {} |
| 247 ProfileImplIOData::LazyParams::~LazyParams() {} | 249 ProfileImplIOData::LazyParams::~LazyParams() {} |
| 248 | 250 |
| 249 ProfileImplIOData::ProfileImplIOData() | 251 ProfileImplIOData::ProfileImplIOData() |
| 250 : ProfileIOData(false), | 252 : ProfileIOData(false), |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 504 scoped_refptr<ChromeURLRequestContext> | 506 scoped_refptr<ChromeURLRequestContext> |
| 505 ProfileImplIOData::AcquireIsolatedAppRequestContext( | 507 ProfileImplIOData::AcquireIsolatedAppRequestContext( |
| 506 scoped_refptr<ChromeURLRequestContext> main_context, | 508 scoped_refptr<ChromeURLRequestContext> main_context, |
| 507 const std::string& app_id) const { | 509 const std::string& app_id) const { |
| 508 // We create per-app contexts on demand, unlike the others above. | 510 // We create per-app contexts on demand, unlike the others above. |
| 509 scoped_refptr<ChromeURLRequestContext> app_request_context = | 511 scoped_refptr<ChromeURLRequestContext> app_request_context = |
| 510 InitializeAppRequestContext(main_context, app_id); | 512 InitializeAppRequestContext(main_context, app_id); |
| 511 DCHECK(app_request_context); | 513 DCHECK(app_request_context); |
| 512 return app_request_context; | 514 return app_request_context; |
| 513 } | 515 } |
| OLD | NEW |