Chromium Code Reviews| Index: chrome/browser/profiles/profile_impl_io_data.cc |
| =================================================================== |
| --- chrome/browser/profiles/profile_impl_io_data.cc (revision 96503) |
| +++ chrome/browser/profiles/profile_impl_io_data.cc (working copy) |
| @@ -12,6 +12,8 @@ |
| #include "chrome/browser/io_thread.h" |
| #include "chrome/browser/net/chrome_net_log.h" |
| #include "chrome/browser/net/chrome_network_delegate.h" |
| +#include "chrome/browser/net/connect_interceptor.h" |
| +#include "chrome/browser/net/predictor.h" |
| #include "chrome/browser/net/sqlite_origin_bound_cert_store.h" |
| #include "chrome/browser/net/sqlite_persistent_cookie_store.h" |
| #include "chrome/browser/prefs/pref_member.h" |
| @@ -25,6 +27,7 @@ |
| #include "net/base/origin_bound_cert_service.h" |
| #include "net/ftp/ftp_network_layer.h" |
| #include "net/http/http_cache.h" |
| +#include "net/url_request/url_request_job_factory.h" |
| ProfileImplIOData::Handle::Handle(Profile* profile) |
| : io_data_(new ProfileImplIOData), |
| @@ -43,6 +46,8 @@ |
| if (extensions_request_context_getter_) |
| extensions_request_context_getter_->CleanupOnUIThread(); |
| + io_data_->predictor_->ShutdownOnUIThread(profile_->GetPrefs()); |
| + |
| // Clean up all isolated app request contexts. |
| for (ChromeURLRequestContextGetterMap::iterator iter = |
| app_request_context_getter_map_.begin(); |
| @@ -54,16 +59,20 @@ |
| io_data_->ShutdownOnUIThread(); |
| } |
| -void ProfileImplIOData::Handle::Init(const FilePath& cookie_path, |
| - const FilePath& origin_bound_cert_path, |
| - const FilePath& cache_path, |
| - int cache_max_size, |
| - const FilePath& media_cache_path, |
| - int media_cache_max_size, |
| - const FilePath& extensions_cookie_path, |
| - const FilePath& app_path) { |
| +void ProfileImplIOData::Handle::Init( |
| + const FilePath& cookie_path, |
| + const FilePath& origin_bound_cert_path, |
| + const FilePath& cache_path, |
| + int cache_max_size, |
| + const FilePath& media_cache_path, |
| + int media_cache_max_size, |
| + const FilePath& extensions_cookie_path, |
| + const FilePath& app_path, |
| + chrome_browser_net::Predictor* predictor) { |
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| DCHECK(!io_data_->lazy_params_.get()); |
| + DCHECK(predictor); |
| + |
| LazyParams* lazy_params = new LazyParams; |
| lazy_params->cookie_path = cookie_path; |
| @@ -78,6 +87,9 @@ |
| // Keep track of isolated app path separately so we can use it on demand. |
| io_data_->app_path_ = app_path; |
| + |
| + io_data_->predictor_.reset(predictor); |
| + io_data_->predictor_->InitNetworkPredictor(profile_->GetPrefs()); |
| } |
| base::Callback<ChromeURLDataManagerBackend*(void)> |
| @@ -180,7 +192,8 @@ |
| ProfileImplIOData::ProfileImplIOData() |
| : ProfileIOData(false), |
| clear_local_state_on_exit_(false) {} |
| -ProfileImplIOData::~ProfileImplIOData() {} |
| +ProfileImplIOData::~ProfileImplIOData() { |
|
willchan no longer on Chromium
2011/08/12 21:17:29
The rest of the file uses {}, can you keep it like
rpetterson
2011/08/13 00:55:17
Done.
|
| +} |
| void ProfileImplIOData::LazyInitializeInternal( |
| ProfileParams* profile_params) const { |
| @@ -336,6 +349,9 @@ |
| media_request_context_->set_job_factory(job_factory()); |
| extensions_context->set_job_factory(job_factory()); |
| + job_factory()->AddInterceptor( |
| + new chrome_browser_net::ConnectInterceptor(predictor_.get())); |
| + |
| lazy_params_.reset(); |
| } |