Chromium Code Reviews| 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 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 235 | 235 |
| 236 if (remove_mask & REMOVE_HISTORY) { | 236 if (remove_mask & REMOVE_HISTORY) { |
| 237 HistoryService* history_service = HistoryServiceFactory::GetForProfile( | 237 HistoryService* history_service = HistoryServiceFactory::GetForProfile( |
| 238 profile_, Profile::EXPLICIT_ACCESS); | 238 profile_, Profile::EXPLICIT_ACCESS); |
| 239 if (history_service) { | 239 if (history_service) { |
| 240 std::set<GURL> restrict_urls; | 240 std::set<GURL> restrict_urls; |
| 241 if (!remove_origin_.is_empty()) | 241 if (!remove_origin_.is_empty()) |
| 242 restrict_urls.insert(remove_origin_); | 242 restrict_urls.insert(remove_origin_); |
| 243 content::RecordAction(UserMetricsAction("ClearBrowsingData_History")); | 243 content::RecordAction(UserMetricsAction("ClearBrowsingData_History")); |
| 244 waiting_for_clear_history_ = true; | 244 waiting_for_clear_history_ = true; |
| 245 // The history service doesn't correctly handle delete_end_. Work around | |
| 246 // it by always passing a NULL time here (it will delete everything until | |
| 247 // delete_begin_). TODO(sky, rohitrao): Remove this workaround when the | |
|
sky
2012/08/31 15:50:06
This worries me in so far as you're assuming delet
rohitrao (ping after 24h)
2012/08/31 15:53:35
Per an earlier comment, the Extensions API allows
| |
| 248 // bug is fixed. | |
| 245 history_service->ExpireHistoryBetween(restrict_urls, | 249 history_service->ExpireHistoryBetween(restrict_urls, |
| 246 delete_begin_, delete_end_, | 250 delete_begin_, base::Time(), |
| 247 &request_consumer_, | 251 &request_consumer_, |
| 248 base::Bind(&BrowsingDataRemover::OnHistoryDeletionDone, | 252 base::Bind(&BrowsingDataRemover::OnHistoryDeletionDone, |
| 249 base::Unretained(this))); | 253 base::Unretained(this))); |
| 250 } | 254 } |
| 251 | 255 |
| 252 // Need to clear the host cache and accumulated speculative data, as it also | 256 // Need to clear the host cache and accumulated speculative data, as it also |
| 253 // reveals some history: we have no mechanism to track when these items were | 257 // reveals some history: we have no mechanism to track when these items were |
| 254 // created, so we'll clear them all. Better safe than sorry. | 258 // created, so we'll clear them all. Better safe than sorry. |
| 255 if (g_browser_process->io_thread()) { | 259 if (g_browser_process->io_thread()) { |
| 256 waiting_for_clear_networking_history_ = true; | 260 waiting_for_clear_networking_history_ = true; |
| (...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 926 BrowserThread::UI, FROM_HERE, | 930 BrowserThread::UI, FROM_HERE, |
| 927 base::Bind(&BrowsingDataRemover::OnClearedFormData, | 931 base::Bind(&BrowsingDataRemover::OnClearedFormData, |
| 928 base::Unretained(this))); | 932 base::Unretained(this))); |
| 929 } | 933 } |
| 930 | 934 |
| 931 void BrowsingDataRemover::OnClearedFormData() { | 935 void BrowsingDataRemover::OnClearedFormData() { |
| 932 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 936 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 933 waiting_for_clear_form_ = false; | 937 waiting_for_clear_form_ = false; |
| 934 NotifyAndDeleteIfDone(); | 938 NotifyAndDeleteIfDone(); |
| 935 } | 939 } |
| OLD | NEW |