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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 | 89 |
90 ProfileImplIOData::Handle::~Handle() { | 90 ProfileImplIOData::Handle::~Handle() { |
91 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 91 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
92 if (io_data_->predictor_ != NULL) { | 92 if (io_data_->predictor_ != NULL) { |
93 // io_data_->predictor_ might be NULL if Init() was never called | 93 // io_data_->predictor_ might be NULL if Init() was never called |
94 // (i.e. we shut down before ProfileImpl::DoFinalInit() got called). | 94 // (i.e. we shut down before ProfileImpl::DoFinalInit() got called). |
95 bool save_prefs = true; | 95 bool save_prefs = true; |
96 #if defined(OS_CHROMEOS) | 96 #if defined(OS_CHROMEOS) |
97 save_prefs = !chromeos::ProfileHelper::IsSigninProfile(profile_); | 97 save_prefs = !chromeos::ProfileHelper::IsSigninProfile(profile_); |
98 #endif | 98 #endif |
99 if (save_prefs) { | 99 if (save_prefs) |
100 io_data_->predictor_->SaveStateForNextStartupAndTrim( | 100 io_data_->predictor_->SaveStateForNextStartupAndTrim(); |
101 profile_->GetPrefs()); | |
102 } | |
103 io_data_->predictor_->ShutdownOnUIThread(); | 101 io_data_->predictor_->ShutdownOnUIThread(); |
104 } | 102 } |
105 | 103 |
106 if (io_data_->http_server_properties_manager_) | 104 if (io_data_->http_server_properties_manager_) |
107 io_data_->http_server_properties_manager_->ShutdownOnPrefThread(); | 105 io_data_->http_server_properties_manager_->ShutdownOnPrefThread(); |
108 io_data_->ShutdownOnUIThread(); | 106 io_data_->ShutdownOnUIThread(); |
109 } | 107 } |
110 | 108 |
111 void ProfileImplIOData::Handle::Init( | 109 void ProfileImplIOData::Handle::Init( |
112 const base::FilePath& cookie_path, | 110 const base::FilePath& cookie_path, |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 177 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
180 LazyInitialize(); | 178 LazyInitialize(); |
181 DCHECK(!main_request_context_getter_.get()); | 179 DCHECK(!main_request_context_getter_.get()); |
182 main_request_context_getter_ = ChromeURLRequestContextGetter::Create( | 180 main_request_context_getter_ = ChromeURLRequestContextGetter::Create( |
183 profile_, io_data_, protocol_handlers, request_interceptors.Pass()); | 181 profile_, io_data_, protocol_handlers, request_interceptors.Pass()); |
184 | 182 |
185 io_data_->predictor_ | 183 io_data_->predictor_ |
186 ->InitNetworkPredictor(profile_->GetPrefs(), | 184 ->InitNetworkPredictor(profile_->GetPrefs(), |
187 local_state, | 185 local_state, |
188 io_thread, | 186 io_thread, |
189 main_request_context_getter_.get()); | 187 main_request_context_getter_.get(), |
| 188 io_data_); |
190 | 189 |
191 content::NotificationService::current()->Notify( | 190 content::NotificationService::current()->Notify( |
192 chrome::NOTIFICATION_PROFILE_URL_REQUEST_CONTEXT_GETTER_INITIALIZED, | 191 chrome::NOTIFICATION_PROFILE_URL_REQUEST_CONTEXT_GETTER_INITIALIZED, |
193 content::Source<Profile>(profile_), | 192 content::Source<Profile>(profile_), |
194 content::NotificationService::NoDetails()); | 193 content::NotificationService::NoDetails()); |
195 return main_request_context_getter_; | 194 return main_request_context_getter_; |
196 } | 195 } |
197 | 196 |
198 scoped_refptr<ChromeURLRequestContextGetter> | 197 scoped_refptr<ChromeURLRequestContextGetter> |
199 ProfileImplIOData::Handle::GetMediaRequestContextGetter() const { | 198 ProfileImplIOData::Handle::GetMediaRequestContextGetter() const { |
(...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
752 const base::Closure& completion) { | 751 const base::Closure& completion) { |
753 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 752 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
754 DCHECK(initialized()); | 753 DCHECK(initialized()); |
755 | 754 |
756 DCHECK(transport_security_state()); | 755 DCHECK(transport_security_state()); |
757 // Completes synchronously. | 756 // Completes synchronously. |
758 transport_security_state()->DeleteAllDynamicDataSince(time); | 757 transport_security_state()->DeleteAllDynamicDataSince(time); |
759 DCHECK(http_server_properties_manager_); | 758 DCHECK(http_server_properties_manager_); |
760 http_server_properties_manager_->Clear(completion); | 759 http_server_properties_manager_->Clear(completion); |
761 } | 760 } |
OLD | NEW |