Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(401)

Side by Side Diff: chrome/browser/browsing_data/browsing_data_remover.cc

Issue 23785002: Clean up activity log URLs when history is cleaned. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix line Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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"
11 #include "base/bind_helpers.h" 11 #include "base/bind_helpers.h"
12 #include "base/callback.h" 12 #include "base/callback.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 "base/prefs/pref_service.h" 15 #include "base/prefs/pref_service.h"
16 #include "chrome/browser/autofill/personal_data_manager_factory.h" 16 #include "chrome/browser/autofill/personal_data_manager_factory.h"
17 #include "chrome/browser/browser_process.h" 17 #include "chrome/browser/browser_process.h"
18 #include "chrome/browser/browsing_data/browsing_data_helper.h" 18 #include "chrome/browser/browsing_data/browsing_data_helper.h"
19 #include "chrome/browser/chrome_notification_types.h" 19 #include "chrome/browser/chrome_notification_types.h"
20 #include "chrome/browser/download/download_prefs.h" 20 #include "chrome/browser/download/download_prefs.h"
21 #include "chrome/browser/download/download_service_factory.h" 21 #include "chrome/browser/download/download_service_factory.h"
22 #include "chrome/browser/extensions/activity_log/activity_log.h"
22 #include "chrome/browser/extensions/extension_service.h" 23 #include "chrome/browser/extensions/extension_service.h"
23 #include "chrome/browser/extensions/extension_special_storage_policy.h" 24 #include "chrome/browser/extensions/extension_special_storage_policy.h"
24 #include "chrome/browser/history/history_service.h" 25 #include "chrome/browser/history/history_service.h"
25 #include "chrome/browser/history/history_service_factory.h" 26 #include "chrome/browser/history/history_service_factory.h"
26 #include "chrome/browser/io_thread.h" 27 #include "chrome/browser/io_thread.h"
27 #include "chrome/browser/nacl_host/nacl_browser.h" 28 #include "chrome/browser/nacl_host/nacl_browser.h"
28 #include "chrome/browser/nacl_host/pnacl_host.h" 29 #include "chrome/browser/nacl_host/pnacl_host.h"
29 #include "chrome/browser/net/chrome_url_request_context.h" 30 #include "chrome/browser/net/chrome_url_request_context.h"
30 #include "chrome/browser/net/predictor.h" 31 #include "chrome/browser/net/predictor.h"
31 #include "chrome/browser/password_manager/password_store.h" 32 #include "chrome/browser/password_manager/password_store.h"
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 if (!remove_origin_.is_empty()) 264 if (!remove_origin_.is_empty())
264 restrict_urls.insert(remove_origin_); 265 restrict_urls.insert(remove_origin_);
265 content::RecordAction(UserMetricsAction("ClearBrowsingData_History")); 266 content::RecordAction(UserMetricsAction("ClearBrowsingData_History"));
266 waiting_for_clear_history_ = true; 267 waiting_for_clear_history_ = true;
267 268
268 history_service->ExpireLocalAndRemoteHistoryBetween( 269 history_service->ExpireLocalAndRemoteHistoryBetween(
269 restrict_urls, delete_begin_, delete_end_, 270 restrict_urls, delete_begin_, delete_end_,
270 base::Bind(&BrowsingDataRemover::OnHistoryDeletionDone, 271 base::Bind(&BrowsingDataRemover::OnHistoryDeletionDone,
271 base::Unretained(this)), 272 base::Unretained(this)),
272 &history_task_tracker_); 273 &history_task_tracker_);
274
275 // The extension activity contains details of which websites extensions
276 // were active on. It therefore indirectly stores details of websites a
277 // user has visited so best clean from here as well.
278 extensions::ActivityLog* activity_log =
279 extensions::ActivityLog::GetInstance(profile_);
280 if (activity_log) {
Bernhard Bauer 2013/09/03 21:55:42 When is this NULL? Also, nit: braces aren't requi
karenlees 2013/09/04 21:35:05 Removed check. If it is not initialized before thi
281 activity_log->RemoveURLs(restrict_urls);
Matt Perry 2013/09/03 22:16:23 FYI, restrict_urls might be empty, in which case t
karenlees 2013/09/04 21:35:05 If the restrict URLs is empty the activity log met
Matt Perry 2013/09/04 21:38:23 Just making sure it was intended. Sounds like it w
282 }
273 } 283 }
274 284
275 // Need to clear the host cache and accumulated speculative data, as it also 285 // Need to clear the host cache and accumulated speculative data, as it also
276 // reveals some history: we have no mechanism to track when these items were 286 // reveals some history: we have no mechanism to track when these items were
277 // created, so we'll clear them all. Better safe than sorry. 287 // created, so we'll clear them all. Better safe than sorry.
278 if (g_browser_process->io_thread()) { 288 if (g_browser_process->io_thread()) {
279 waiting_for_clear_hostname_resolution_cache_ = true; 289 waiting_for_clear_hostname_resolution_cache_ = true;
280 BrowserThread::PostTask( 290 BrowserThread::PostTask(
281 BrowserThread::IO, FROM_HERE, 291 BrowserThread::IO, FROM_HERE,
282 base::Bind( 292 base::Bind(
(...skipping 885 matching lines...) Expand 10 before | Expand all | Expand 10 after
1168 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 1178 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
1169 waiting_for_clear_autofill_origin_urls_ = false; 1179 waiting_for_clear_autofill_origin_urls_ = false;
1170 NotifyAndDeleteIfDone(); 1180 NotifyAndDeleteIfDone();
1171 } 1181 }
1172 1182
1173 void BrowsingDataRemover::OnClearWebRTCIdentityStore() { 1183 void BrowsingDataRemover::OnClearWebRTCIdentityStore() {
1174 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 1184 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
1175 waiting_for_clear_webrtc_identity_store_ = false; 1185 waiting_for_clear_webrtc_identity_store_ = false;
1176 NotifyAndDeleteIfDone(); 1186 NotifyAndDeleteIfDone();
1177 } 1187 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698