| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/stl_util-inl.h" | 10 #include "base/stl_util-inl.h" |
| 11 #include "chrome/browser/io_thread.h" | 11 #include "chrome/browser/io_thread.h" |
| 12 #include "chrome/browser/net/chrome_net_log.h" | 12 #include "chrome/browser/net/chrome_net_log.h" |
| 13 #include "chrome/browser/net/chrome_network_delegate.h" | 13 #include "chrome/browser/net/chrome_network_delegate.h" |
| 14 #include "chrome/browser/net/sqlite_persistent_cookie_store.h" | 14 #include "chrome/browser/net/sqlite_persistent_cookie_store.h" |
| 15 #include "chrome/browser/prefs/pref_member.h" |
| 15 #include "chrome/common/chrome_constants.h" | 16 #include "chrome/common/chrome_constants.h" |
| 16 #include "chrome/common/chrome_switches.h" | 17 #include "chrome/common/chrome_switches.h" |
| 17 #include "chrome/common/pref_names.h" | 18 #include "chrome/common/pref_names.h" |
| 18 #include "chrome/common/url_constants.h" | 19 #include "chrome/common/url_constants.h" |
| 19 #include "content/browser/browser_thread.h" | 20 #include "content/browser/browser_thread.h" |
| 20 #include "content/browser/resource_context.h" | 21 #include "content/browser/resource_context.h" |
| 21 #include "net/ftp/ftp_network_layer.h" | 22 #include "net/ftp/ftp_network_layer.h" |
| 22 #include "net/http/http_cache.h" | 23 #include "net/http/http_cache.h" |
| 23 | 24 |
| 24 ProfileImplIOData::Handle::Handle(Profile* profile) | 25 ProfileImplIOData::Handle::Handle(Profile* profile) |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 } | 141 } |
| 141 | 142 |
| 142 void ProfileImplIOData::Handle::LazyInitialize() const { | 143 void ProfileImplIOData::Handle::LazyInitialize() const { |
| 143 if (!initialized_) { | 144 if (!initialized_) { |
| 144 io_data_->InitializeProfileParams(profile_); | 145 io_data_->InitializeProfileParams(profile_); |
| 145 ChromeNetworkDelegate::InitializeReferrersEnabled( | 146 ChromeNetworkDelegate::InitializeReferrersEnabled( |
| 146 io_data_->enable_referrers(), profile_->GetPrefs()); | 147 io_data_->enable_referrers(), profile_->GetPrefs()); |
| 147 io_data_->clear_local_state_on_exit()->Init( | 148 io_data_->clear_local_state_on_exit()->Init( |
| 148 prefs::kClearSiteDataOnExit, profile_->GetPrefs(), NULL); | 149 prefs::kClearSiteDataOnExit, profile_->GetPrefs(), NULL); |
| 149 io_data_->clear_local_state_on_exit()->MoveToThread(BrowserThread::IO); | 150 io_data_->clear_local_state_on_exit()->MoveToThread(BrowserThread::IO); |
| 151 io_data_->safe_browsing_enabled()->Init(prefs::kSafeBrowsingEnabled, |
| 152 profile_->GetPrefs(), NULL); |
| 153 io_data_->safe_browsing_enabled()->MoveToThread(BrowserThread::IO); |
| 150 initialized_ = true; | 154 initialized_ = true; |
| 151 } | 155 } |
| 152 } | 156 } |
| 153 | 157 |
| 154 ProfileImplIOData::LazyParams::LazyParams() | 158 ProfileImplIOData::LazyParams::LazyParams() |
| 155 : cache_max_size(0), | 159 : cache_max_size(0), |
| 156 media_cache_max_size(0) {} | 160 media_cache_max_size(0) {} |
| 157 ProfileImplIOData::LazyParams::~LazyParams() {} | 161 ProfileImplIOData::LazyParams::~LazyParams() {} |
| 158 | 162 |
| 159 ProfileImplIOData::ProfileImplIOData() | 163 ProfileImplIOData::ProfileImplIOData() |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 ProfileImplIOData::AcquireIsolatedAppRequestContext( | 378 ProfileImplIOData::AcquireIsolatedAppRequestContext( |
| 375 scoped_refptr<ChromeURLRequestContext> main_context, | 379 scoped_refptr<ChromeURLRequestContext> main_context, |
| 376 const std::string& app_id) const { | 380 const std::string& app_id) const { |
| 377 // We create per-app contexts on demand, unlike the others above. | 381 // We create per-app contexts on demand, unlike the others above. |
| 378 scoped_refptr<RequestContext> app_request_context = | 382 scoped_refptr<RequestContext> app_request_context = |
| 379 InitializeAppRequestContext(main_context, app_id); | 383 InitializeAppRequestContext(main_context, app_id); |
| 380 DCHECK(app_request_context); | 384 DCHECK(app_request_context); |
| 381 app_request_context->set_profile_io_data(this); | 385 app_request_context->set_profile_io_data(this); |
| 382 return app_request_context; | 386 return app_request_context; |
| 383 } | 387 } |
| OLD | NEW |