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/callback.h" | 10 #include "base/callback.h" |
11 #include "base/file_util.h" | 11 #include "base/file_util.h" |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
13 #include "base/platform_file.h" | 13 #include "base/platform_file.h" |
14 #include "chrome/browser/autofill/personal_data_manager.h" | 14 #include "chrome/browser/autofill/personal_data_manager.h" |
15 #include "chrome/browser/browser_process.h" | 15 #include "chrome/browser/browser_process.h" |
16 #include "chrome/browser/extensions/extension_service.h" | 16 #include "chrome/browser/extensions/extension_service.h" |
17 #include "chrome/browser/extensions/extension_special_storage_policy.h" | 17 #include "chrome/browser/extensions/extension_special_storage_policy.h" |
18 #include "chrome/browser/history/history.h" | 18 #include "chrome/browser/history/history.h" |
19 #include "chrome/browser/io_thread.h" | 19 #include "chrome/browser/io_thread.h" |
20 #include "chrome/browser/net/chrome_net_log.h" | 20 #include "chrome/browser/net/chrome_net_log.h" |
21 #include "chrome/browser/net/chrome_url_request_context.h" | 21 #include "chrome/browser/net/chrome_url_request_context.h" |
| 22 #include "chrome/browser/net/predictor.h" |
22 #include "chrome/browser/password_manager/password_store.h" | 23 #include "chrome/browser/password_manager/password_store.h" |
23 #include "chrome/browser/plugin_data_remover.h" | 24 #include "chrome/browser/plugin_data_remover.h" |
24 #include "chrome/browser/prerender/prerender_manager.h" | 25 #include "chrome/browser/prerender/prerender_manager.h" |
25 #include "chrome/browser/profiles/profile.h" | 26 #include "chrome/browser/profiles/profile.h" |
26 #include "chrome/browser/renderer_host/web_cache_manager.h" | 27 #include "chrome/browser/renderer_host/web_cache_manager.h" |
27 #include "chrome/browser/search_engines/template_url_service.h" | 28 #include "chrome/browser/search_engines/template_url_service.h" |
28 #include "chrome/browser/search_engines/template_url_service_factory.h" | 29 #include "chrome/browser/search_engines/template_url_service_factory.h" |
29 #include "chrome/browser/sessions/session_service.h" | 30 #include "chrome/browser/sessions/session_service.h" |
30 #include "chrome/browser/sessions/session_service_factory.h" | 31 #include "chrome/browser/sessions/session_service_factory.h" |
31 #include "chrome/browser/sessions/tab_restore_service.h" | 32 #include "chrome/browser/sessions/tab_restore_service.h" |
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 void BrowsingDataRemover::ClearedNetworkHistory() { | 359 void BrowsingDataRemover::ClearedNetworkHistory() { |
359 waiting_for_clear_networking_history_ = false; | 360 waiting_for_clear_networking_history_ = false; |
360 | 361 |
361 NotifyAndDeleteIfDone(); | 362 NotifyAndDeleteIfDone(); |
362 } | 363 } |
363 | 364 |
364 void BrowsingDataRemover::ClearNetworkingHistory(IOThread* io_thread) { | 365 void BrowsingDataRemover::ClearNetworkingHistory(IOThread* io_thread) { |
365 // This function should be called on the IO thread. | 366 // This function should be called on the IO thread. |
366 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 367 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
367 | 368 |
368 io_thread->ClearNetworkingHistory(); | 369 io_thread->ClearHostCache(); |
| 370 |
| 371 chrome_browser_net::Predictor* predictor = profile_->GetNetworkPredictor(); |
| 372 if (predictor) { |
| 373 predictor->DiscardInitialNavigationHistory(); |
| 374 predictor->DiscardAllResults(); |
| 375 } |
369 | 376 |
370 // Notify the UI thread that we are done. | 377 // Notify the UI thread that we are done. |
371 BrowserThread::PostTask( | 378 BrowserThread::PostTask( |
372 BrowserThread::UI, FROM_HERE, | 379 BrowserThread::UI, FROM_HERE, |
373 NewRunnableMethod(this, &BrowsingDataRemover::ClearedNetworkHistory)); | 380 NewRunnableMethod(this, &BrowsingDataRemover::ClearedNetworkHistory)); |
374 } | 381 } |
375 | 382 |
376 void BrowsingDataRemover::ClearedCache() { | 383 void BrowsingDataRemover::ClearedCache() { |
377 waiting_for_clear_cache_ = false; | 384 waiting_for_clear_cache_ = false; |
378 | 385 |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
525 NewRunnableMethod( | 532 NewRunnableMethod( |
526 this, | 533 this, |
527 &BrowsingDataRemover::NotifyAndDeleteIfDone)); | 534 &BrowsingDataRemover::NotifyAndDeleteIfDone)); |
528 } | 535 } |
529 | 536 |
530 void BrowsingDataRemover::OnWaitableEventSignaled( | 537 void BrowsingDataRemover::OnWaitableEventSignaled( |
531 base::WaitableEvent* waitable_event) { | 538 base::WaitableEvent* waitable_event) { |
532 waiting_for_clear_lso_data_ = false; | 539 waiting_for_clear_lso_data_ = false; |
533 NotifyAndDeleteIfDone(); | 540 NotifyAndDeleteIfDone(); |
534 } | 541 } |
OLD | NEW |