| Index: chrome/browser/profiles/profile_impl_io_data.cc
|
| diff --git a/chrome/browser/profiles/profile_impl_io_data.cc b/chrome/browser/profiles/profile_impl_io_data.cc
|
| index faba3535fa634f92fc430102620364147e664686..7922438e987ee29ed84da8260ea234e6f22c1487 100644
|
| --- a/chrome/browser/profiles/profile_impl_io_data.cc
|
| +++ b/chrome/browser/profiles/profile_impl_io_data.cc
|
| @@ -141,6 +141,26 @@ void ProfileImplIOData::Handle::Init(
|
| io_data_->InitializeMetricsEnabledStateOnUIThread();
|
| }
|
|
|
| +void ProfileImplIOData::Handle::InitForTesting() const {
|
| + using chrome_browser_net::HttpServerPropertiesManager;
|
| +
|
| + initialized_ = true;
|
| +
|
| + // Set up an HttpServerPropertiesManager for testing removing browsing data.
|
| + PrefService* pref_service = profile_->GetPrefs();
|
| + io_data_->set_http_server_properties_manager(
|
| + new HttpServerPropertiesManager(pref_service));
|
| +
|
| + BrowserThread::PostTask(
|
| + BrowserThread::IO,
|
| + FROM_HERE,
|
| + base::Bind(
|
| + &HttpServerPropertiesManager::InitializeOnIOThread,
|
| + base::Unretained(io_data_->http_server_properties_manager())));
|
| +
|
| + io_data_->InitForTesting();
|
| +}
|
| +
|
| base::Callback<ChromeURLDataManagerBackend*(void)>
|
| ProfileImplIOData::Handle::GetChromeURLDataManagerBackendGetter() const {
|
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
| @@ -258,7 +278,8 @@ ProfileImplIOData::Handle::GetIsolatedMediaRequestContextGetter(
|
| }
|
|
|
| void ProfileImplIOData::Handle::ClearNetworkingHistorySince(
|
| - base::Time time) {
|
| + base::Time time,
|
| + const base::Closure& completion) {
|
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
| LazyInitialize();
|
|
|
| @@ -267,7 +288,8 @@ void ProfileImplIOData::Handle::ClearNetworkingHistorySince(
|
| base::Bind(
|
| &ProfileImplIOData::ClearNetworkingHistorySinceOnIOThread,
|
| base::Unretained(io_data_),
|
| - time));
|
| + time,
|
| + completion));
|
| }
|
|
|
| void ProfileImplIOData::Handle::LazyInitialize() const {
|
| @@ -663,12 +685,13 @@ void ProfileImplIOData::SetUpJobFactory(
|
| }
|
|
|
| void ProfileImplIOData::ClearNetworkingHistorySinceOnIOThread(
|
| - base::Time time) {
|
| + base::Time time,
|
| + const base::Closure& completion) {
|
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
|
| LazyInitialize();
|
|
|
| DCHECK(transport_security_state());
|
| - transport_security_state()->DeleteSince(time);
|
| + transport_security_state()->DeleteSince(time); // Completes synchronously.
|
| DCHECK(http_server_properties_manager());
|
| - http_server_properties_manager()->Clear();
|
| + http_server_properties_manager()->Clear(completion);
|
| }
|
|
|