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/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 GetIsolatedAppRequestContextGetter(app_id); | 251 GetIsolatedAppRequestContextGetter(app_id); |
252 ChromeURLRequestContextGetter* context = | 252 ChromeURLRequestContextGetter* context = |
253 ChromeURLRequestContextGetter::CreateOriginalForIsolatedMedia( | 253 ChromeURLRequestContextGetter::CreateOriginalForIsolatedMedia( |
254 profile_, app_context, io_data_, app_id); | 254 profile_, app_context, io_data_, app_id); |
255 isolated_media_request_context_getter_map_[app_id] = context; | 255 isolated_media_request_context_getter_map_[app_id] = context; |
256 | 256 |
257 return context; | 257 return context; |
258 } | 258 } |
259 | 259 |
260 void ProfileImplIOData::Handle::ClearNetworkingHistorySince( | 260 void ProfileImplIOData::Handle::ClearNetworkingHistorySince( |
261 base::Time time) { | 261 base::Time time, |
| 262 const base::Closure& completion) { |
262 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 263 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
263 LazyInitialize(); | 264 LazyInitialize(); |
264 | 265 |
265 BrowserThread::PostTask( | 266 BrowserThread::PostTask( |
266 BrowserThread::IO, FROM_HERE, | 267 BrowserThread::IO, FROM_HERE, |
267 base::Bind( | 268 base::Bind( |
268 &ProfileImplIOData::ClearNetworkingHistorySinceOnIOThread, | 269 &ProfileImplIOData::ClearNetworkingHistorySinceOnIOThread, |
269 base::Unretained(io_data_), | 270 base::Unretained(io_data_), |
270 time)); | 271 time, |
| 272 completion)); |
271 } | 273 } |
272 | 274 |
273 void ProfileImplIOData::Handle::LazyInitialize() const { | 275 void ProfileImplIOData::Handle::LazyInitialize() const { |
274 if (initialized_) | 276 if (initialized_) |
275 return; | 277 return; |
276 | 278 |
277 // Set initialized_ to true at the beginning in case any of the objects | 279 // Set initialized_ to true at the beginning in case any of the objects |
278 // below try to get the ResourceContext pointer. | 280 // below try to get the ResourceContext pointer. |
279 initialized_ = true; | 281 initialized_ = true; |
280 PrefService* pref_service = profile_->GetPrefs(); | 282 PrefService* pref_service = profile_->GetPrefs(); |
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
656 net::FtpAuthCache* ftp_auth_cache) const { | 658 net::FtpAuthCache* ftp_auth_cache) const { |
657 SetUpJobFactoryDefaults(job_factory, protocol_handler_interceptor.Pass(), | 659 SetUpJobFactoryDefaults(job_factory, protocol_handler_interceptor.Pass(), |
658 network_delegate, ftp_transaction_factory, | 660 network_delegate, ftp_transaction_factory, |
659 ftp_auth_cache); | 661 ftp_auth_cache); |
660 | 662 |
661 job_factory->AddInterceptor( | 663 job_factory->AddInterceptor( |
662 new chrome_browser_net::ConnectInterceptor(predictor_.get())); | 664 new chrome_browser_net::ConnectInterceptor(predictor_.get())); |
663 } | 665 } |
664 | 666 |
665 void ProfileImplIOData::ClearNetworkingHistorySinceOnIOThread( | 667 void ProfileImplIOData::ClearNetworkingHistorySinceOnIOThread( |
666 base::Time time) { | 668 base::Time time, |
| 669 const base::Closure& completion) { |
667 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 670 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
668 LazyInitialize(); | 671 LazyInitialize(); |
669 | 672 |
670 DCHECK(transport_security_state()); | 673 DCHECK(transport_security_state()); |
671 transport_security_state()->DeleteSince(time); | 674 transport_security_state()->DeleteSince(time); // Completes synchronously. |
672 DCHECK(http_server_properties_manager()); | 675 DCHECK(http_server_properties_manager()); |
673 http_server_properties_manager()->Clear(); | 676 http_server_properties_manager()->Clear(completion); |
674 } | 677 } |
OLD | NEW |