| 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" |
| 11 #include "base/prefs/pref_member.h" | 11 #include "base/prefs/pref_member.h" |
| 12 #include "base/prefs/pref_service.h" | 12 #include "base/prefs/pref_service.h" |
| 13 #include "base/sequenced_task_runner.h" | 13 #include "base/sequenced_task_runner.h" |
| 14 #include "base/stl_util.h" | 14 #include "base/stl_util.h" |
| 15 #include "base/strings/string_util.h" | 15 #include "base/strings/string_util.h" |
| 16 #include "base/threading/sequenced_worker_pool.h" | 16 #include "base/threading/sequenced_worker_pool.h" |
| 17 #include "base/threading/worker_pool.h" | 17 #include "base/threading/worker_pool.h" |
| 18 #include "chrome/browser/chrome_notification_types.h" | 18 #include "chrome/browser/chrome_notification_types.h" |
| 19 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| 19 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" | 20 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" |
| 20 #include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h" | 21 #include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h" |
| 21 #include "chrome/browser/extensions/extension_protocols.h" | 22 #include "chrome/browser/extensions/extension_protocols.h" |
| 22 #include "chrome/browser/io_thread.h" | 23 #include "chrome/browser/io_thread.h" |
| 23 #include "chrome/browser/net/chrome_net_log.h" | 24 #include "chrome/browser/net/chrome_net_log.h" |
| 24 #include "chrome/browser/net/chrome_network_delegate.h" | 25 #include "chrome/browser/net/chrome_network_delegate.h" |
| 25 #include "chrome/browser/net/connect_interceptor.h" | 26 #include "chrome/browser/net/connect_interceptor.h" |
| 26 #include "chrome/browser/net/http_server_properties_manager.h" | 27 #include "chrome/browser/net/http_server_properties_manager.h" |
| 27 #include "chrome/browser/net/predictor.h" | 28 #include "chrome/browser/net/predictor.h" |
| 28 #include "chrome/browser/net/sqlite_server_bound_cert_store.h" | 29 #include "chrome/browser/net/sqlite_server_bound_cert_store.h" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 DCHECK(profile); | 91 DCHECK(profile); |
| 91 } | 92 } |
| 92 | 93 |
| 93 ProfileImplIOData::Handle::~Handle() { | 94 ProfileImplIOData::Handle::~Handle() { |
| 94 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 95 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 95 if (io_data_->predictor_ != NULL) { | 96 if (io_data_->predictor_ != NULL) { |
| 96 // io_data_->predictor_ might be NULL if Init() was never called | 97 // io_data_->predictor_ might be NULL if Init() was never called |
| 97 // (i.e. we shut down before ProfileImpl::DoFinalInit() got called). | 98 // (i.e. we shut down before ProfileImpl::DoFinalInit() got called). |
| 98 bool save_prefs = true; | 99 bool save_prefs = true; |
| 99 #if defined(OS_CHROMEOS) | 100 #if defined(OS_CHROMEOS) |
| 100 save_prefs = !profile_->IsLoginProfile(); | 101 save_prefs = !chromeos::ProfileHelper::IsSigninProfile(profile_); |
| 101 #endif | 102 #endif |
| 102 if (save_prefs) { | 103 if (save_prefs) { |
| 103 io_data_->predictor_->SaveStateForNextStartupAndTrim( | 104 io_data_->predictor_->SaveStateForNextStartupAndTrim( |
| 104 profile_->GetPrefs()); | 105 profile_->GetPrefs()); |
| 105 } | 106 } |
| 106 io_data_->predictor_->ShutdownOnUIThread(); | 107 io_data_->predictor_->ShutdownOnUIThread(); |
| 107 } | 108 } |
| 108 | 109 |
| 109 if (io_data_->http_server_properties_manager_) | 110 if (io_data_->http_server_properties_manager_) |
| 110 io_data_->http_server_properties_manager_->ShutdownOnUIThread(); | 111 io_data_->http_server_properties_manager_->ShutdownOnUIThread(); |
| (...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 701 const base::Closure& completion) { | 702 const base::Closure& completion) { |
| 702 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 703 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 703 DCHECK(initialized()); | 704 DCHECK(initialized()); |
| 704 | 705 |
| 705 DCHECK(transport_security_state()); | 706 DCHECK(transport_security_state()); |
| 706 // Completes synchronously. | 707 // Completes synchronously. |
| 707 transport_security_state()->DeleteAllDynamicDataSince(time); | 708 transport_security_state()->DeleteAllDynamicDataSince(time); |
| 708 DCHECK(http_server_properties_manager_); | 709 DCHECK(http_server_properties_manager_); |
| 709 http_server_properties_manager_->Clear(completion); | 710 http_server_properties_manager_->Clear(completion); |
| 710 } | 711 } |
| OLD | NEW |