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/browsing_data/browsing_data_remover.h" | 5 #include "chrome/browser/browsing_data/browsing_data_remover.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 // were active on. It therefore indirectly stores details of websites a | 303 // were active on. It therefore indirectly stores details of websites a |
304 // user has visited so best clean from here as well. | 304 // user has visited so best clean from here as well. |
305 extensions::ActivityLog::GetInstance(profile_)->RemoveURLs(restrict_urls); | 305 extensions::ActivityLog::GetInstance(profile_)->RemoveURLs(restrict_urls); |
306 #endif | 306 #endif |
307 } | 307 } |
308 | 308 |
309 // The power consumption history by origin contains details of websites | 309 // The power consumption history by origin contains details of websites |
310 // that were visited. | 310 // that were visited. |
311 power::OriginPowerMap* origin_power_map = | 311 power::OriginPowerMap* origin_power_map = |
312 power::OriginPowerMapFactory::GetForBrowserContext(profile_); | 312 power::OriginPowerMapFactory::GetForBrowserContext(profile_); |
313 origin_power_map->ClearOriginMap(); | 313 if (origin_power_map) |
| 314 origin_power_map->ClearOriginMap(); |
314 | 315 |
315 // Need to clear the host cache and accumulated speculative data, as it also | 316 // Need to clear the host cache and accumulated speculative data, as it also |
316 // reveals some history: we have no mechanism to track when these items were | 317 // reveals some history: we have no mechanism to track when these items were |
317 // created, so we'll clear them all. Better safe than sorry. | 318 // created, so we'll clear them all. Better safe than sorry. |
318 if (g_browser_process->io_thread()) { | 319 if (g_browser_process->io_thread()) { |
319 waiting_for_clear_hostname_resolution_cache_ = true; | 320 waiting_for_clear_hostname_resolution_cache_ = true; |
320 BrowserThread::PostTask( | 321 BrowserThread::PostTask( |
321 BrowserThread::IO, FROM_HERE, | 322 BrowserThread::IO, FROM_HERE, |
322 base::Bind( | 323 base::Bind( |
323 &BrowsingDataRemover::ClearHostnameResolutionCacheOnIOThread, | 324 &BrowsingDataRemover::ClearHostnameResolutionCacheOnIOThread, |
(...skipping 879 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1203 waiting_for_clear_webrtc_logs_ = false; | 1204 waiting_for_clear_webrtc_logs_ = false; |
1204 NotifyAndDeleteIfDone(); | 1205 NotifyAndDeleteIfDone(); |
1205 } | 1206 } |
1206 #endif | 1207 #endif |
1207 | 1208 |
1208 void BrowsingDataRemover::OnClearedDomainReliabilityMonitor() { | 1209 void BrowsingDataRemover::OnClearedDomainReliabilityMonitor() { |
1209 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 1210 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
1210 waiting_for_clear_domain_reliability_monitor_ = false; | 1211 waiting_for_clear_domain_reliability_monitor_ = false; |
1211 NotifyAndDeleteIfDone(); | 1212 NotifyAndDeleteIfDone(); |
1212 } | 1213 } |
OLD | NEW |