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