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 755 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
766 if (!BrowsingDataHelper::DoesOriginMatchMask(origin->GetOrigin(), | 766 if (!BrowsingDataHelper::DoesOriginMatchMask(origin->GetOrigin(), |
767 origin_set_mask_, | 767 origin_set_mask_, |
768 special_storage_policy_)) | 768 special_storage_policy_)) |
769 continue; | 769 continue; |
770 | 770 |
771 ++quota_managed_origins_to_delete_count_; | 771 ++quota_managed_origins_to_delete_count_; |
772 quota_manager_->DeleteOriginData( | 772 quota_manager_->DeleteOriginData( |
773 origin->GetOrigin(), type, | 773 origin->GetOrigin(), type, |
774 BrowsingDataRemover::GenerateQuotaClientMask(remove_mask_), | 774 BrowsingDataRemover::GenerateQuotaClientMask(remove_mask_), |
775 base::Bind(&BrowsingDataRemover::OnQuotaManagedOriginDeletion, | 775 base::Bind(&BrowsingDataRemover::OnQuotaManagedOriginDeletion, |
776 base::Unretained(this))); | 776 base::Unretained(this), origin->GetOrigin(), type)); |
777 } | 777 } |
778 | 778 |
779 --quota_managed_storage_types_to_delete_count_; | 779 --quota_managed_storage_types_to_delete_count_; |
780 CheckQuotaManagedDataDeletionStatus(); | 780 CheckQuotaManagedDataDeletionStatus(); |
781 } | 781 } |
782 | 782 |
783 void BrowsingDataRemover::OnQuotaManagedOriginDeletion( | 783 void BrowsingDataRemover::OnQuotaManagedOriginDeletion( |
| 784 const GURL& origin, |
| 785 quota::StorageType type, |
784 quota::QuotaStatusCode status) { | 786 quota::QuotaStatusCode status) { |
785 DCHECK_GT(quota_managed_origins_to_delete_count_, 0); | 787 DCHECK_GT(quota_managed_origins_to_delete_count_, 0); |
786 if (status != quota::kQuotaStatusOk) { | 788 if (status != quota::kQuotaStatusOk) { |
787 // TODO(mkwst): We should add the GURL to StatusCallback; this is a pretty | 789 DLOG(ERROR) << "Couldn't remove data of type " << type << " for origin " |
788 // worthless error message otherwise. | 790 << origin << ". Status: " << status; |
789 DLOG(ERROR) << "Couldn't remove origin. Status: " << status; | |
790 } | 791 } |
791 | 792 |
792 --quota_managed_origins_to_delete_count_; | 793 --quota_managed_origins_to_delete_count_; |
793 CheckQuotaManagedDataDeletionStatus(); | 794 CheckQuotaManagedDataDeletionStatus(); |
794 } | 795 } |
795 | 796 |
796 void BrowsingDataRemover::CheckQuotaManagedDataDeletionStatus() { | 797 void BrowsingDataRemover::CheckQuotaManagedDataDeletionStatus() { |
797 if (quota_managed_storage_types_to_delete_count_ != 0 || | 798 if (quota_managed_storage_types_to_delete_count_ != 0 || |
798 quota_managed_origins_to_delete_count_ != 0) { | 799 quota_managed_origins_to_delete_count_ != 0) { |
799 return; | 800 return; |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
863 BrowserThread::UI, FROM_HERE, | 864 BrowserThread::UI, FROM_HERE, |
864 base::Bind(&BrowsingDataRemover::OnClearedServerBoundCerts, | 865 base::Bind(&BrowsingDataRemover::OnClearedServerBoundCerts, |
865 base::Unretained(this))); | 866 base::Unretained(this))); |
866 } | 867 } |
867 | 868 |
868 void BrowsingDataRemover::OnClearedServerBoundCerts() { | 869 void BrowsingDataRemover::OnClearedServerBoundCerts() { |
869 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 870 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
870 waiting_for_clear_server_bound_certs_ = false; | 871 waiting_for_clear_server_bound_certs_ = false; |
871 NotifyAndDeleteIfDone(); | 872 NotifyAndDeleteIfDone(); |
872 } | 873 } |
OLD | NEW |