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 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 908 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
919 | 919 |
920 if (delete_begin_ == base::Time() || | 920 if (delete_begin_ == base::Time() || |
921 origin_type_mask_ & | 921 origin_type_mask_ & |
922 (BrowsingDataHelper::PROTECTED_WEB | BrowsingDataHelper::EXTENSION)) { | 922 (BrowsingDataHelper::PROTECTED_WEB | BrowsingDataHelper::EXTENSION)) { |
923 // If we're deleting since the beginning of time, or we're removing | 923 // If we're deleting since the beginning of time, or we're removing |
924 // protected origins, then remove persistent quota data. | 924 // protected origins, then remove persistent quota data. |
925 quota_storage_remove_mask |= | 925 quota_storage_remove_mask |= |
926 content::StoragePartition::QUOTA_MANAGED_STORAGE_MASK_PERSISTENT; | 926 content::StoragePartition::QUOTA_MANAGED_STORAGE_MASK_PERSISTENT; |
927 } | 927 } |
928 | 928 |
| 929 // If cookies are supposed to be conditionally deleted from the storage |
| 930 // partition, create a cookie matcher function. |
929 content::StoragePartition::CookieMatcherFunction cookie_matcher; | 931 content::StoragePartition::CookieMatcherFunction cookie_matcher; |
930 if (!filter_builder.IsEmptyBlacklist()) { | 932 if (!filter_builder.IsEmptyBlacklist() && |
| 933 (storage_partition_remove_mask & |
| 934 content::StoragePartition::REMOVE_DATA_MASK_COOKIES)) { |
931 cookie_matcher = filter_builder.BuildCookieFilter(); | 935 cookie_matcher = filter_builder.BuildCookieFilter(); |
932 } | 936 } |
| 937 |
933 storage_partition->ClearData( | 938 storage_partition->ClearData( |
934 storage_partition_remove_mask, quota_storage_remove_mask, | 939 storage_partition_remove_mask, quota_storage_remove_mask, |
935 base::Bind(&DoesOriginMatchMaskAndUrls, origin_type_mask_, filter), | 940 base::Bind(&DoesOriginMatchMaskAndUrls, origin_type_mask_, filter), |
936 cookie_matcher, delete_begin_, delete_end_, | 941 cookie_matcher, delete_begin_, delete_end_, |
937 base::Bind(&BrowsingDataRemover::OnClearedStoragePartitionData, | 942 base::Bind(&BrowsingDataRemover::OnClearedStoragePartitionData, |
938 weak_ptr_factory_.GetWeakPtr())); | 943 weak_ptr_factory_.GetWeakPtr())); |
939 } | 944 } |
940 | 945 |
941 #if defined(ENABLE_PLUGINS) | 946 #if defined(ENABLE_PLUGINS) |
942 if (remove_mask & REMOVE_CONTENT_LICENSES) { | 947 if (remove_mask & REMOVE_CONTENT_LICENSES) { |
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1331 waiting_for_clear_domain_reliability_monitor_ = false; | 1336 waiting_for_clear_domain_reliability_monitor_ = false; |
1332 NotifyIfDone(); | 1337 NotifyIfDone(); |
1333 } | 1338 } |
1334 | 1339 |
1335 // static | 1340 // static |
1336 BrowsingDataRemover::CallbackSubscription | 1341 BrowsingDataRemover::CallbackSubscription |
1337 BrowsingDataRemover::RegisterOnBrowsingDataRemovedCallback( | 1342 BrowsingDataRemover::RegisterOnBrowsingDataRemovedCallback( |
1338 const BrowsingDataRemover::Callback& callback) { | 1343 const BrowsingDataRemover::Callback& callback) { |
1339 return GetOnBrowsingDataRemovedCallbacks()->Add(callback); | 1344 return GetOnBrowsingDataRemovedCallbacks()->Add(callback); |
1340 } | 1345 } |
OLD | NEW |