| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_remover.h" | 5 #include "chrome/browser/browsing_data_remover.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| 11 #include "base/callback.h" | 11 #include "base/callback.h" |
| 12 #include "base/file_util.h" | 12 #include "base/file_util.h" |
| 13 #include "base/logging.h" | 13 #include "base/logging.h" |
| 14 #include "base/platform_file.h" | 14 #include "base/platform_file.h" |
| 15 #include "chrome/browser/autofill/personal_data_manager.h" | 15 #include "chrome/browser/autofill/personal_data_manager.h" |
| 16 #include "chrome/browser/browser_process.h" | 16 #include "chrome/browser/browser_process.h" |
| 17 #include "chrome/browser/extensions/extension_service.h" | 17 #include "chrome/browser/extensions/extension_service.h" |
| 18 #include "chrome/browser/extensions/extension_special_storage_policy.h" | 18 #include "chrome/browser/extensions/extension_special_storage_policy.h" |
| 19 #include "chrome/browser/history/history.h" | 19 #include "chrome/browser/history/history.h" |
| 20 #include "chrome/browser/io_thread.h" | 20 #include "chrome/browser/io_thread.h" |
| 21 #include "chrome/browser/net/chrome_net_log.h" | 21 #include "chrome/browser/net/chrome_net_log.h" |
| 22 #include "chrome/browser/net/chrome_url_request_context.h" | 22 #include "chrome/browser/net/chrome_url_request_context.h" |
| 23 #include "chrome/browser/net/predictor.h" |
| 23 #include "chrome/browser/password_manager/password_store.h" | 24 #include "chrome/browser/password_manager/password_store.h" |
| 24 #include "chrome/browser/plugin_data_remover.h" | 25 #include "chrome/browser/plugin_data_remover.h" |
| 25 #include "chrome/browser/prefs/pref_member.h" | 26 #include "chrome/browser/prefs/pref_member.h" |
| 26 #include "chrome/browser/prerender/prerender_manager.h" | 27 #include "chrome/browser/prerender/prerender_manager.h" |
| 27 #include "chrome/browser/profiles/profile.h" | 28 #include "chrome/browser/profiles/profile.h" |
| 28 #include "chrome/browser/renderer_host/web_cache_manager.h" | 29 #include "chrome/browser/renderer_host/web_cache_manager.h" |
| 29 #include "chrome/browser/search_engines/template_url_service.h" | 30 #include "chrome/browser/search_engines/template_url_service.h" |
| 30 #include "chrome/browser/search_engines/template_url_service_factory.h" | 31 #include "chrome/browser/search_engines/template_url_service_factory.h" |
| 31 #include "chrome/browser/sessions/session_service.h" | 32 #include "chrome/browser/sessions/session_service.h" |
| 32 #include "chrome/browser/sessions/session_service_factory.h" | 33 #include "chrome/browser/sessions/session_service_factory.h" |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 381 void BrowsingDataRemover::ClearedNetworkHistory() { | 382 void BrowsingDataRemover::ClearedNetworkHistory() { |
| 382 waiting_for_clear_networking_history_ = false; | 383 waiting_for_clear_networking_history_ = false; |
| 383 | 384 |
| 384 NotifyAndDeleteIfDone(); | 385 NotifyAndDeleteIfDone(); |
| 385 } | 386 } |
| 386 | 387 |
| 387 void BrowsingDataRemover::ClearNetworkingHistory(IOThread* io_thread) { | 388 void BrowsingDataRemover::ClearNetworkingHistory(IOThread* io_thread) { |
| 388 // This function should be called on the IO thread. | 389 // This function should be called on the IO thread. |
| 389 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 390 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 390 | 391 |
| 391 io_thread->ClearNetworkingHistory(); | 392 io_thread->ClearHostCache(); |
| 393 |
| 394 chrome_browser_net::Predictor* predictor = profile_->GetNetworkPredictor(); |
| 395 if (predictor) { |
| 396 predictor->DiscardInitialNavigationHistory(); |
| 397 predictor->DiscardAllResults(); |
| 398 } |
| 392 | 399 |
| 393 // Notify the UI thread that we are done. | 400 // Notify the UI thread that we are done. |
| 394 BrowserThread::PostTask( | 401 BrowserThread::PostTask( |
| 395 BrowserThread::UI, FROM_HERE, | 402 BrowserThread::UI, FROM_HERE, |
| 396 NewRunnableMethod(this, &BrowsingDataRemover::ClearedNetworkHistory)); | 403 NewRunnableMethod(this, &BrowsingDataRemover::ClearedNetworkHistory)); |
| 397 } | 404 } |
| 398 | 405 |
| 399 void BrowsingDataRemover::ClearedCache() { | 406 void BrowsingDataRemover::ClearedCache() { |
| 400 waiting_for_clear_cache_ = false; | 407 waiting_for_clear_cache_ = false; |
| 401 | 408 |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 577 GetURLRequestContext()->cookie_store()->GetCookieMonster(); | 584 GetURLRequestContext()->cookie_store()->GetCookieMonster(); |
| 578 if (cookie_monster) { | 585 if (cookie_monster) { |
| 579 cookie_monster->DeleteAllCreatedBetweenAsync( | 586 cookie_monster->DeleteAllCreatedBetweenAsync( |
| 580 delete_begin_, delete_end_, true, | 587 delete_begin_, delete_end_, true, |
| 581 base::Bind(&BrowsingDataRemover::OnClearedCookies, | 588 base::Bind(&BrowsingDataRemover::OnClearedCookies, |
| 582 base::Unretained(this))); | 589 base::Unretained(this))); |
| 583 } else { | 590 } else { |
| 584 OnClearedCookies(0); | 591 OnClearedCookies(0); |
| 585 } | 592 } |
| 586 } | 593 } |
| OLD | NEW |