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 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 | 303 |
304 BrowserThread::PostTask( | 304 BrowserThread::PostTask( |
305 BrowserThread::IO, FROM_HERE, | 305 BrowserThread::IO, FROM_HERE, |
306 base::Bind( | 306 base::Bind( |
307 &ProfileImplIOData::ClearNetworkingHistorySinceOnIOThread, | 307 &ProfileImplIOData::ClearNetworkingHistorySinceOnIOThread, |
308 base::Unretained(io_data_), | 308 base::Unretained(io_data_), |
309 time, | 309 time, |
310 completion)); | 310 completion)); |
311 } | 311 } |
312 | 312 |
| 313 void ProfileImplIOData::Handle::ClearDomainReliabilityMonitor( |
| 314 domain_reliability::DomainReliabilityClearMode mode, |
| 315 const base::Closure& completion) { |
| 316 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 317 LazyInitialize(); |
| 318 |
| 319 BrowserThread::PostTask( |
| 320 BrowserThread::IO, FROM_HERE, |
| 321 base::Bind( |
| 322 &ProfileImplIOData::ClearDomainReliabilityMonitorOnIOThread, |
| 323 base::Unretained(io_data_), |
| 324 mode, |
| 325 completion)); |
| 326 } |
| 327 |
313 void ProfileImplIOData::Handle::LazyInitialize() const { | 328 void ProfileImplIOData::Handle::LazyInitialize() const { |
314 if (initialized_) | 329 if (initialized_) |
315 return; | 330 return; |
316 | 331 |
317 // Set initialized_ to true at the beginning in case any of the objects | 332 // Set initialized_ to true at the beginning in case any of the objects |
318 // below try to get the ResourceContext pointer. | 333 // below try to get the ResourceContext pointer. |
319 initialized_ = true; | 334 initialized_ = true; |
320 PrefService* pref_service = profile_->GetPrefs(); | 335 PrefService* pref_service = profile_->GetPrefs(); |
321 io_data_->http_server_properties_manager_ = | 336 io_data_->http_server_properties_manager_ = |
322 new chrome_browser_net::HttpServerPropertiesManager(pref_service); | 337 new chrome_browser_net::HttpServerPropertiesManager(pref_service); |
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
737 const base::Closure& completion) { | 752 const base::Closure& completion) { |
738 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 753 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
739 DCHECK(initialized()); | 754 DCHECK(initialized()); |
740 | 755 |
741 DCHECK(transport_security_state()); | 756 DCHECK(transport_security_state()); |
742 // Completes synchronously. | 757 // Completes synchronously. |
743 transport_security_state()->DeleteAllDynamicDataSince(time); | 758 transport_security_state()->DeleteAllDynamicDataSince(time); |
744 DCHECK(http_server_properties_manager_); | 759 DCHECK(http_server_properties_manager_); |
745 http_server_properties_manager_->Clear(completion); | 760 http_server_properties_manager_->Clear(completion); |
746 } | 761 } |
| 762 |
| 763 void ProfileImplIOData::ClearDomainReliabilityMonitorOnIOThread( |
| 764 domain_reliability::DomainReliabilityClearMode mode, |
| 765 const base::Closure& completion) { |
| 766 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 767 DCHECK(initialized()); |
| 768 |
| 769 if (domain_reliability_monitor_) |
| 770 domain_reliability_monitor_->ClearBrowsingData(mode); |
| 771 |
| 772 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, completion); |
| 773 } |
OLD | NEW |