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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 ProfileImplIOData::Handle::Handle(Profile* profile) | 90 ProfileImplIOData::Handle::Handle(Profile* profile) |
91 : io_data_(new ProfileImplIOData), | 91 : io_data_(new ProfileImplIOData), |
92 profile_(profile), | 92 profile_(profile), |
93 initialized_(false) { | 93 initialized_(false) { |
94 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 94 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
95 DCHECK(profile); | 95 DCHECK(profile); |
96 } | 96 } |
97 | 97 |
98 ProfileImplIOData::Handle::~Handle() { | 98 ProfileImplIOData::Handle::~Handle() { |
99 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 99 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
100 io_data_->data_reduction_proxy_statistics_prefs()->WritePrefs(); | 100 io_data_->data_reduction_proxy_statistics_prefs()->WriteStats(); |
101 | 101 |
102 if (io_data_->predictor_ != NULL) { | 102 if (io_data_->predictor_ != NULL) { |
103 // io_data_->predictor_ might be NULL if Init() was never called | 103 // io_data_->predictor_ might be NULL if Init() was never called |
104 // (i.e. we shut down before ProfileImpl::DoFinalInit() got called). | 104 // (i.e. we shut down before ProfileImpl::DoFinalInit() got called). |
105 bool save_prefs = true; | 105 bool save_prefs = true; |
106 #if defined(OS_CHROMEOS) | 106 #if defined(OS_CHROMEOS) |
107 save_prefs = !chromeos::ProfileHelper::IsSigninProfile(profile_); | 107 save_prefs = !chromeos::ProfileHelper::IsSigninProfile(profile_); |
108 #endif | 108 #endif |
109 if (save_prefs) | 109 if (save_prefs) |
110 io_data_->predictor_->SaveStateForNextStartupAndTrim(); | 110 io_data_->predictor_->SaveStateForNextStartupAndTrim(); |
(...skipping 722 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
833 transport_security_state()->DeleteAllDynamicDataSince(time); | 833 transport_security_state()->DeleteAllDynamicDataSince(time); |
834 DCHECK(http_server_properties_manager_); | 834 DCHECK(http_server_properties_manager_); |
835 http_server_properties_manager_->Clear(completion); | 835 http_server_properties_manager_->Clear(completion); |
836 } | 836 } |
837 | 837 |
838 bool ProfileImplIOData::IsDataReductionProxyEnabled() const { | 838 bool ProfileImplIOData::IsDataReductionProxyEnabled() const { |
839 return data_reduction_proxy_enabled_.GetValue() || | 839 return data_reduction_proxy_enabled_.GetValue() || |
840 CommandLine::ForCurrentProcess()->HasSwitch( | 840 CommandLine::ForCurrentProcess()->HasSwitch( |
841 data_reduction_proxy::switches::kEnableDataReductionProxy); | 841 data_reduction_proxy::switches::kEnableDataReductionProxy); |
842 } | 842 } |
OLD | NEW |