| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "chrome/browser/chrome_thread.h" | 8 #include "chrome/browser/chrome_thread.h" |
| 9 #include "chrome/browser/download/download_manager.h" | 9 #include "chrome/browser/download/download_manager.h" |
| 10 #include "chrome/browser/history/history.h" | 10 #include "chrome/browser/history/history.h" |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 ChromeThread::FILE, FROM_HERE, | 136 ChromeThread::FILE, FROM_HERE, |
| 137 NewRunnableMethod( | 137 NewRunnableMethod( |
| 138 this, | 138 this, |
| 139 &BrowsingDataRemover::ClearDatabasesOnFILEThread, | 139 &BrowsingDataRemover::ClearDatabasesOnFILEThread, |
| 140 delete_begin_)); | 140 delete_begin_)); |
| 141 } | 141 } |
| 142 | 142 |
| 143 net::TransportSecurityState* ts_state = | 143 net::TransportSecurityState* ts_state = |
| 144 profile_->GetTransportSecurityState(); | 144 profile_->GetTransportSecurityState(); |
| 145 ts_state->DeleteSince(delete_begin_); | 145 ts_state->DeleteSince(delete_begin_); |
| 146 |
| 147 // TODO(michaeln): clear appcaches created in the date range |
| 146 } | 148 } |
| 147 | 149 |
| 148 if (remove_mask & REMOVE_PASSWORDS) { | 150 if (remove_mask & REMOVE_PASSWORDS) { |
| 149 UserMetrics::RecordAction("ClearBrowsingData_Passwords", profile_); | 151 UserMetrics::RecordAction("ClearBrowsingData_Passwords", profile_); |
| 150 PasswordStore* password_store = | 152 PasswordStore* password_store = |
| 151 profile_->GetPasswordStore(Profile::EXPLICIT_ACCESS); | 153 profile_->GetPasswordStore(Profile::EXPLICIT_ACCESS); |
| 152 | 154 |
| 153 password_store->RemoveLoginsCreatedBetween(delete_begin_, delete_end_); | 155 password_store->RemoveLoginsCreatedBetween(delete_begin_, delete_end_); |
| 154 } | 156 } |
| 155 | 157 |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 | 327 |
| 326 void BrowsingDataRemover::ClearDatabasesOnFILEThread(base::Time delete_begin) { | 328 void BrowsingDataRemover::ClearDatabasesOnFILEThread(base::Time delete_begin) { |
| 327 // This function should be called on the FILE thread. | 329 // This function should be called on the FILE thread. |
| 328 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE)); | 330 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE)); |
| 329 | 331 |
| 330 int rv = database_tracker_->DeleteDataModifiedSince( | 332 int rv = database_tracker_->DeleteDataModifiedSince( |
| 331 delete_begin, &database_cleared_callback_); | 333 delete_begin, &database_cleared_callback_); |
| 332 if (rv != net::ERR_IO_PENDING) | 334 if (rv != net::ERR_IO_PENDING) |
| 333 OnClearedDatabases(rv); | 335 OnClearedDatabases(rv); |
| 334 } | 336 } |
| OLD | NEW |