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