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/logging.h" | 9 #include "base/logging.h" |
10 #include "base/metrics/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 save_prefs = !chromeos::ProfileHelper::IsSigninProfile(profile_); | 109 save_prefs = !chromeos::ProfileHelper::IsSigninProfile(profile_); |
110 #endif | 110 #endif |
111 if (save_prefs) | 111 if (save_prefs) |
112 io_data_->predictor_->SaveStateForNextStartupAndTrim(); | 112 io_data_->predictor_->SaveStateForNextStartupAndTrim(); |
113 io_data_->predictor_->ShutdownOnUIThread(); | 113 io_data_->predictor_->ShutdownOnUIThread(); |
114 } | 114 } |
115 | 115 |
116 if (io_data_->http_server_properties_manager_) | 116 if (io_data_->http_server_properties_manager_) |
117 io_data_->http_server_properties_manager_->ShutdownOnPrefThread(); | 117 io_data_->http_server_properties_manager_->ShutdownOnPrefThread(); |
118 | 118 |
| 119 if (io_data_->domain_reliability_monitor_) |
| 120 io_data_->domain_reliability_monitor_->DestroyReportingPref(); |
| 121 |
119 io_data_->ShutdownOnUIThread(GetAllContextGetters().Pass()); | 122 io_data_->ShutdownOnUIThread(GetAllContextGetters().Pass()); |
120 } | 123 } |
121 | 124 |
122 void ProfileImplIOData::Handle::Init( | 125 void ProfileImplIOData::Handle::Init( |
123 const base::FilePath& cookie_path, | 126 const base::FilePath& cookie_path, |
124 const base::FilePath& channel_id_path, | 127 const base::FilePath& channel_id_path, |
125 const base::FilePath& cache_path, | 128 const base::FilePath& cache_path, |
126 int cache_max_size, | 129 int cache_max_size, |
127 const base::FilePath& media_cache_path, | 130 const base::FilePath& media_cache_path, |
128 int media_cache_max_size, | 131 int media_cache_max_size, |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 // Keep track of profile path and cache sizes separately so we can use them | 164 // Keep track of profile path and cache sizes separately so we can use them |
162 // on demand when creating storage isolated URLRequestContextGetters. | 165 // on demand when creating storage isolated URLRequestContextGetters. |
163 io_data_->profile_path_ = profile_path; | 166 io_data_->profile_path_ = profile_path; |
164 io_data_->app_cache_max_size_ = cache_max_size; | 167 io_data_->app_cache_max_size_ = cache_max_size; |
165 io_data_->app_media_cache_max_size_ = media_cache_max_size; | 168 io_data_->app_media_cache_max_size_ = media_cache_max_size; |
166 | 169 |
167 io_data_->predictor_.reset(predictor); | 170 io_data_->predictor_.reset(predictor); |
168 io_data_->domain_reliability_monitor_ = domain_reliability_monitor.Pass(); | 171 io_data_->domain_reliability_monitor_ = domain_reliability_monitor.Pass(); |
169 | 172 |
170 io_data_->InitializeMetricsEnabledStateOnUIThread(); | 173 io_data_->InitializeMetricsEnabledStateOnUIThread(); |
| 174 if (io_data_->domain_reliability_monitor_) |
| 175 io_data_->domain_reliability_monitor_->MoveToNetworkThread(); |
171 | 176 |
172 #if defined(SPDY_PROXY_AUTH_ORIGIN) | 177 #if defined(SPDY_PROXY_AUTH_ORIGIN) |
173 io_data_->data_reduction_proxy_unavailable_callback_ = | 178 io_data_->data_reduction_proxy_unavailable_callback_ = |
174 data_reduction_proxy_unavailable; | 179 data_reduction_proxy_unavailable; |
175 io_data_->data_reduction_proxy_chrome_configurator_ = | 180 io_data_->data_reduction_proxy_chrome_configurator_ = |
176 data_reduction_proxy_chrome_configurator.Pass(); | 181 data_reduction_proxy_chrome_configurator.Pass(); |
177 io_data_->data_reduction_proxy_params_ = | 182 io_data_->data_reduction_proxy_params_ = |
178 data_reduction_proxy_params.Pass(); | 183 data_reduction_proxy_params.Pass(); |
179 #endif // defined(SPDY_PROXY_AUTH_ORIGIN) | 184 #endif // defined(SPDY_PROXY_AUTH_ORIGIN) |
180 } | 185 } |
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
590 | 595 |
591 main_context->set_sdch_manager(sdch_manager_.get()); | 596 main_context->set_sdch_manager(sdch_manager_.get()); |
592 | 597 |
593 // Create a media request context based on the main context, but using a | 598 // Create a media request context based on the main context, but using a |
594 // media cache. It shares the same job factory as the main context. | 599 // media cache. It shares the same job factory as the main context. |
595 StoragePartitionDescriptor details(profile_path_, false); | 600 StoragePartitionDescriptor details(profile_path_, false); |
596 media_request_context_.reset(InitializeMediaRequestContext(main_context, | 601 media_request_context_.reset(InitializeMediaRequestContext(main_context, |
597 details)); | 602 details)); |
598 | 603 |
599 if (domain_reliability_monitor_) { | 604 if (domain_reliability_monitor_) { |
600 domain_reliability_monitor_->Init( | 605 domain_reliability::DomainReliabilityMonitor* monitor = |
601 main_context, | 606 domain_reliability_monitor_.get(); |
602 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); | 607 monitor->InitURLRequestContext(main_context); |
603 domain_reliability_monitor_->AddBakedInConfigs(); | 608 monitor->AddBakedInConfigs(); |
604 network_delegate()->set_domain_reliability_monitor( | 609 network_delegate()->set_domain_reliability_monitor(monitor); |
605 domain_reliability_monitor_.get()); | |
606 } | 610 } |
607 | 611 |
608 lazy_params_.reset(); | 612 lazy_params_.reset(); |
609 } | 613 } |
610 | 614 |
611 void ProfileImplIOData:: | 615 void ProfileImplIOData:: |
612 InitializeExtensionsRequestContext(ProfileParams* profile_params) const { | 616 InitializeExtensionsRequestContext(ProfileParams* profile_params) const { |
613 net::URLRequestContext* extensions_context = extensions_request_context(); | 617 net::URLRequestContext* extensions_context = extensions_request_context(); |
614 IOThread* const io_thread = profile_params->io_thread; | 618 IOThread* const io_thread = profile_params->io_thread; |
615 IOThread::Globals* const io_thread_globals = io_thread->globals(); | 619 IOThread::Globals* const io_thread_globals = io_thread->globals(); |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
831 const base::Closure& completion) { | 835 const base::Closure& completion) { |
832 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 836 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
833 DCHECK(initialized()); | 837 DCHECK(initialized()); |
834 | 838 |
835 DCHECK(transport_security_state()); | 839 DCHECK(transport_security_state()); |
836 // Completes synchronously. | 840 // Completes synchronously. |
837 transport_security_state()->DeleteAllDynamicDataSince(time); | 841 transport_security_state()->DeleteAllDynamicDataSince(time); |
838 DCHECK(http_server_properties_manager_); | 842 DCHECK(http_server_properties_manager_); |
839 http_server_properties_manager_->Clear(completion); | 843 http_server_properties_manager_->Clear(completion); |
840 } | 844 } |
OLD | NEW |