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

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

Issue 2647683002: Consolidate Origin- and RegistrableDomain- FilterBuilder into one class (Closed)
Patch Set: Fix memory leak. Created 3 years, 11 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/chrome_browsing_data_remover_delegate.h" 5 #include "chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.h"
6 6
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 10
11 #include "base/callback.h" 11 #include "base/callback.h"
12 #include "chrome/browser/autofill/personal_data_manager_factory.h" 12 #include "chrome/browser/autofill/personal_data_manager_factory.h"
13 #include "chrome/browser/bookmarks/bookmark_model_factory.h" 13 #include "chrome/browser/bookmarks/bookmark_model_factory.h"
14 #include "chrome/browser/browser_process.h" 14 #include "chrome/browser/browser_process.h"
15 #include "chrome/browser/browsing_data/browsing_data_filter_builder.h" 15 #include "chrome/browser/browsing_data/browsing_data_filter_builder.h"
16 #include "chrome/browser/browsing_data/browsing_data_helper.h" 16 #include "chrome/browser/browsing_data/browsing_data_helper.h"
17 #include "chrome/browser/browsing_data/registrable_domain_filter_builder.h"
18 #include "chrome/browser/chrome_notification_types.h" 17 #include "chrome/browser/chrome_notification_types.h"
19 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" 18 #include "chrome/browser/content_settings/host_content_settings_map_factory.h"
20 #include "chrome/browser/domain_reliability/service_factory.h" 19 #include "chrome/browser/domain_reliability/service_factory.h"
21 #include "chrome/browser/download/download_prefs.h" 20 #include "chrome/browser/download/download_prefs.h"
22 #include "chrome/browser/history/history_service_factory.h" 21 #include "chrome/browser/history/history_service_factory.h"
23 #include "chrome/browser/history/web_history_service_factory.h" 22 #include "chrome/browser/history/web_history_service_factory.h"
24 #include "chrome/browser/io_thread.h" 23 #include "chrome/browser/io_thread.h"
25 #include "chrome/browser/media/media_device_id_salt.h" 24 #include "chrome/browser/media/media_device_id_salt.h"
26 #include "chrome/browser/net/nqe/ui_network_quality_estimator_service.h" 25 #include "chrome/browser/net/nqe/ui_network_quality_estimator_service.h"
27 #include "chrome/browser/net/nqe/ui_network_quality_estimator_service_factory.h" 26 #include "chrome/browser/net/nqe/ui_network_quality_estimator_service_factory.h"
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 // user has visited so best clean from here as well. 381 // user has visited so best clean from here as well.
383 // TODO(msramek): Support all backends with filter (crbug.com/589586). 382 // TODO(msramek): Support all backends with filter (crbug.com/589586).
384 extensions::ActivityLog::GetInstance(profile_)->RemoveURLs( 383 extensions::ActivityLog::GetInstance(profile_)->RemoveURLs(
385 std::set<GURL>()); 384 std::set<GURL>());
386 385
387 // Clear launch times as they are a form of history. 386 // Clear launch times as they are a form of history.
388 // BrowsingDataFilterBuilder currently doesn't support extension origins. 387 // BrowsingDataFilterBuilder currently doesn't support extension origins.
389 // Therefore, clearing history for a small set of origins (WHITELIST) should 388 // Therefore, clearing history for a small set of origins (WHITELIST) should
390 // never delete any extension launch times, while clearing for almost all 389 // never delete any extension launch times, while clearing for almost all
391 // origins (BLACKLIST) should always delete all of extension launch times. 390 // origins (BLACKLIST) should always delete all of extension launch times.
392 if (filter_builder.mode() == BrowsingDataFilterBuilder::BLACKLIST) { 391 if (filter_builder.GetMode() == BrowsingDataFilterBuilder::BLACKLIST) {
393 extensions::ExtensionPrefs* extension_prefs = 392 extensions::ExtensionPrefs* extension_prefs =
394 extensions::ExtensionPrefs::Get(profile_); 393 extensions::ExtensionPrefs::Get(profile_);
395 extension_prefs->ClearLastLaunchTimes(); 394 extension_prefs->ClearLastLaunchTimes();
396 } 395 }
397 #endif 396 #endif
398 397
399 // Need to clear the host cache and accumulated speculative data, as it also 398 // Need to clear the host cache and accumulated speculative data, as it also
400 // reveals some history. We have no mechanism to track when these items were 399 // reveals some history. We have no mechanism to track when these items were
401 // created, so we'll not honor the time range. 400 // created, so we'll not honor the time range.
402 // TODO(msramek): We can use the plugin filter here because plugins, same 401 // TODO(msramek): We can use the plugin filter here because plugins, same
(...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after
1041 } 1040 }
1042 1041
1043 void ChromeBrowsingDataRemoverDelegate:: 1042 void ChromeBrowsingDataRemoverDelegate::
1044 OnDeauthorizeFlashContentLicensesCompleted( 1043 OnDeauthorizeFlashContentLicensesCompleted(
1045 uint32_t request_id, 1044 uint32_t request_id,
1046 bool /* success */) { 1045 bool /* success */) {
1047 DCHECK_EQ(request_id, deauthorize_flash_content_licenses_request_id_); 1046 DCHECK_EQ(request_id, deauthorize_flash_content_licenses_request_id_);
1048 clear_flash_content_licenses_.GetCompletionCallback().Run(); 1047 clear_flash_content_licenses_.GetCompletionCallback().Run();
1049 } 1048 }
1050 #endif 1049 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698