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_remover.h" | 5 #include "chrome/browser/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 767 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
778 if (!BrowsingDataHelper::DoesOriginMatchMask(origin->GetOrigin(), | 778 if (!BrowsingDataHelper::DoesOriginMatchMask(origin->GetOrigin(), |
779 origin_set_mask_, | 779 origin_set_mask_, |
780 special_storage_policy_)) | 780 special_storage_policy_)) |
781 continue; | 781 continue; |
782 | 782 |
783 ++quota_managed_origins_to_delete_count_; | 783 ++quota_managed_origins_to_delete_count_; |
784 quota_manager_->DeleteOriginData( | 784 quota_manager_->DeleteOriginData( |
785 origin->GetOrigin(), type, | 785 origin->GetOrigin(), type, |
786 BrowsingDataRemover::GenerateQuotaClientMask(remove_mask_), | 786 BrowsingDataRemover::GenerateQuotaClientMask(remove_mask_), |
787 base::Bind(&BrowsingDataRemover::OnQuotaManagedOriginDeletion, | 787 base::Bind(&BrowsingDataRemover::OnQuotaManagedOriginDeletion, |
788 base::Unretained(this))); | 788 base::Unretained(this), origin->GetOrigin(), type)); |
789 } | 789 } |
790 | 790 |
791 --quota_managed_storage_types_to_delete_count_; | 791 --quota_managed_storage_types_to_delete_count_; |
792 CheckQuotaManagedDataDeletionStatus(); | 792 CheckQuotaManagedDataDeletionStatus(); |
793 } | 793 } |
794 | 794 |
795 void BrowsingDataRemover::OnQuotaManagedOriginDeletion( | 795 void BrowsingDataRemover::OnQuotaManagedOriginDeletion( |
| 796 const GURL& origin, |
| 797 quota::StorageType type, |
796 quota::QuotaStatusCode status) { | 798 quota::QuotaStatusCode status) { |
797 DCHECK_GT(quota_managed_origins_to_delete_count_, 0); | 799 DCHECK_GT(quota_managed_origins_to_delete_count_, 0); |
798 if (status != quota::kQuotaStatusOk) { | 800 if (status != quota::kQuotaStatusOk) { |
799 // TODO(mkwst): We should add the GURL to StatusCallback; this is a pretty | 801 DLOG(ERROR) << "Couldn't remove data of type " << type << " for origin " |
800 // worthless error message otherwise. | 802 << origin << ". Status: " << status; |
801 DLOG(ERROR) << "Couldn't remove origin. Status: " << status; | |
802 } | 803 } |
803 | 804 |
804 --quota_managed_origins_to_delete_count_; | 805 --quota_managed_origins_to_delete_count_; |
805 CheckQuotaManagedDataDeletionStatus(); | 806 CheckQuotaManagedDataDeletionStatus(); |
806 } | 807 } |
807 | 808 |
808 void BrowsingDataRemover::CheckQuotaManagedDataDeletionStatus() { | 809 void BrowsingDataRemover::CheckQuotaManagedDataDeletionStatus() { |
809 if (quota_managed_storage_types_to_delete_count_ != 0 || | 810 if (quota_managed_storage_types_to_delete_count_ != 0 || |
810 quota_managed_origins_to_delete_count_ != 0) { | 811 quota_managed_origins_to_delete_count_ != 0) { |
811 return; | 812 return; |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
875 BrowserThread::UI, FROM_HERE, | 876 BrowserThread::UI, FROM_HERE, |
876 base::Bind(&BrowsingDataRemover::OnClearedServerBoundCerts, | 877 base::Bind(&BrowsingDataRemover::OnClearedServerBoundCerts, |
877 base::Unretained(this))); | 878 base::Unretained(this))); |
878 } | 879 } |
879 | 880 |
880 void BrowsingDataRemover::OnClearedServerBoundCerts() { | 881 void BrowsingDataRemover::OnClearedServerBoundCerts() { |
881 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 882 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
882 waiting_for_clear_server_bound_certs_ = false; | 883 waiting_for_clear_server_bound_certs_ = false; |
883 NotifyAndDeleteIfDone(); | 884 NotifyAndDeleteIfDone(); |
884 } | 885 } |
OLD | NEW |