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 865 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
876 base::Bind(&BrowsingDataRemover::OnGotQuotaManagedOrigins, | 876 base::Bind(&BrowsingDataRemover::OnGotQuotaManagedOrigins, |
877 base::Unretained(this))); | 877 base::Unretained(this))); |
878 } | 878 } |
879 | 879 |
880 // Do the same for temporary quota. | 880 // Do the same for temporary quota. |
881 ++quota_managed_storage_types_to_delete_count_; | 881 ++quota_managed_storage_types_to_delete_count_; |
882 quota_manager_->GetOriginsModifiedSince( | 882 quota_manager_->GetOriginsModifiedSince( |
883 quota::kStorageTypeTemporary, delete_begin_, | 883 quota::kStorageTypeTemporary, delete_begin_, |
884 base::Bind(&BrowsingDataRemover::OnGotQuotaManagedOrigins, | 884 base::Bind(&BrowsingDataRemover::OnGotQuotaManagedOrigins, |
885 base::Unretained(this))); | 885 base::Unretained(this))); |
| 886 |
| 887 // Do the same for syncable quota. |
| 888 ++quota_managed_storage_types_to_delete_count_; |
| 889 quota_manager_->GetOriginsModifiedSince( |
| 890 quota::kStorageTypeSyncable, delete_begin_, |
| 891 base::Bind(&BrowsingDataRemover::OnGotQuotaManagedOrigins, |
| 892 base::Unretained(this))); |
| 893 |
886 } | 894 } |
887 | 895 |
888 void BrowsingDataRemover::OnGotQuotaManagedOrigins( | 896 void BrowsingDataRemover::OnGotQuotaManagedOrigins( |
889 const std::set<GURL>& origins, quota::StorageType type) { | 897 const std::set<GURL>& origins, quota::StorageType type) { |
890 DCHECK_GT(quota_managed_storage_types_to_delete_count_, 0); | 898 DCHECK_GT(quota_managed_storage_types_to_delete_count_, 0); |
891 // Walk through the origins passed in, delete quota of |type| from each that | 899 // Walk through the origins passed in, delete quota of |type| from each that |
892 // matches the |origin_set_mask_|. | 900 // matches the |origin_set_mask_|. |
893 std::set<GURL>::const_iterator origin; | 901 std::set<GURL>::const_iterator origin; |
894 for (origin = origins.begin(); origin != origins.end(); ++origin) { | 902 for (origin = origins.begin(); origin != origins.end(); ++origin) { |
895 // TODO(mkwst): Clean this up, it's slow. http://crbug.com/130746 | 903 // TODO(mkwst): Clean this up, it's slow. http://crbug.com/130746 |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1025 BrowserThread::UI, FROM_HERE, | 1033 BrowserThread::UI, FROM_HERE, |
1026 base::Bind(&BrowsingDataRemover::OnClearedFormData, | 1034 base::Bind(&BrowsingDataRemover::OnClearedFormData, |
1027 base::Unretained(this))); | 1035 base::Unretained(this))); |
1028 } | 1036 } |
1029 | 1037 |
1030 void BrowsingDataRemover::OnClearedFormData() { | 1038 void BrowsingDataRemover::OnClearedFormData() { |
1031 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 1039 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
1032 waiting_for_clear_form_ = false; | 1040 waiting_for_clear_form_ = false; |
1033 NotifyAndDeleteIfDone(); | 1041 NotifyAndDeleteIfDone(); |
1034 } | 1042 } |
OLD | NEW |