Chromium Code Reviews| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 54 #include "net/base/server_bound_cert_service.h" | 54 #include "net/base/server_bound_cert_service.h" |
| 55 #include "net/base/server_bound_cert_store.h" | 55 #include "net/base/server_bound_cert_store.h" |
| 56 #include "net/base/transport_security_state.h" | 56 #include "net/base/transport_security_state.h" |
| 57 #include "net/cookies/cookie_store.h" | 57 #include "net/cookies/cookie_store.h" |
| 58 #include "net/disk_cache/disk_cache.h" | 58 #include "net/disk_cache/disk_cache.h" |
| 59 #include "net/http/http_cache.h" | 59 #include "net/http/http_cache.h" |
| 60 #include "net/url_request/url_request_context.h" | 60 #include "net/url_request/url_request_context.h" |
| 61 #include "net/url_request/url_request_context_getter.h" | 61 #include "net/url_request/url_request_context_getter.h" |
| 62 #include "webkit/quota/quota_manager.h" | 62 #include "webkit/quota/quota_manager.h" |
| 63 #include "webkit/quota/quota_types.h" | 63 #include "webkit/quota/quota_types.h" |
| 64 #include "webkit/quota/special_storage_policy.h" | |
| 64 | 65 |
| 65 using content::BrowserContext; | 66 using content::BrowserContext; |
| 66 using content::BrowserThread; | 67 using content::BrowserThread; |
| 67 using content::DOMStorageContext; | 68 using content::DOMStorageContext; |
| 68 using content::DownloadManager; | 69 using content::DownloadManager; |
| 69 using content::UserMetricsAction; | 70 using content::UserMetricsAction; |
| 70 | 71 |
| 71 bool BrowsingDataRemover::removing_ = false; | 72 bool BrowsingDataRemover::removing_ = false; |
| 72 | 73 |
| 73 BrowsingDataRemover::NotificationDetails::NotificationDetails() | 74 BrowsingDataRemover::NotificationDetails::NotificationDetails() |
| 74 : removal_begin(base::Time()), | 75 : removal_begin(base::Time()), |
| 75 removal_mask(-1) { | 76 removal_mask(-1) { |
| 76 } | 77 } |
| 77 | 78 |
| 78 BrowsingDataRemover::NotificationDetails::NotificationDetails( | 79 BrowsingDataRemover::NotificationDetails::NotificationDetails( |
| 79 const BrowsingDataRemover::NotificationDetails& details) | 80 const BrowsingDataRemover::NotificationDetails& details) |
| 80 : removal_begin(details.removal_begin), | 81 : removal_begin(details.removal_begin), |
| 81 removal_mask(details.removal_mask) { | 82 removal_mask(details.removal_mask) { |
| 82 } | 83 } |
| 83 | 84 |
| 84 BrowsingDataRemover::NotificationDetails::NotificationDetails( | 85 BrowsingDataRemover::NotificationDetails::NotificationDetails( |
| 85 base::Time removal_begin, | 86 base::Time removal_begin, |
| 86 int removal_mask) | 87 int removal_mask) |
| 87 : removal_begin(removal_begin), | 88 : removal_begin(removal_begin), |
| 88 removal_mask(removal_mask) { | 89 removal_mask(removal_mask) { |
| 89 } | 90 } |
| 90 | 91 |
| 91 BrowsingDataRemover::NotificationDetails::~NotificationDetails() {} | 92 BrowsingDataRemover::NotificationDetails::~NotificationDetails() {} |
| 92 | 93 |
| 94 // TODO(mkwst): We should have one constructor, not two. http://crbug.com/130732 | |
| 93 BrowsingDataRemover::BrowsingDataRemover(Profile* profile, | 95 BrowsingDataRemover::BrowsingDataRemover(Profile* profile, |
| 94 base::Time delete_begin, | 96 base::Time delete_begin, |
| 95 base::Time delete_end) | 97 base::Time delete_end) |
| 96 : profile_(profile), | 98 : profile_(profile), |
| 97 quota_manager_(NULL), | 99 quota_manager_(NULL), |
| 100 dom_storage_context_(NULL), | |
| 98 special_storage_policy_(profile->GetExtensionSpecialStoragePolicy()), | 101 special_storage_policy_(profile->GetExtensionSpecialStoragePolicy()), |
| 99 delete_begin_(delete_begin), | 102 delete_begin_(delete_begin), |
| 100 delete_end_(delete_end), | 103 delete_end_(delete_end), |
| 101 next_cache_state_(STATE_NONE), | 104 next_cache_state_(STATE_NONE), |
| 102 cache_(NULL), | 105 cache_(NULL), |
| 103 main_context_getter_(profile->GetRequestContext()), | 106 main_context_getter_(profile->GetRequestContext()), |
| 104 media_context_getter_(profile->GetRequestContextForMedia()), | 107 media_context_getter_(profile->GetRequestContextForMedia()), |
| 105 deauthorize_content_licenses_request_id_(0), | 108 deauthorize_content_licenses_request_id_(0), |
| 106 waiting_for_clear_cache_(false), | 109 waiting_for_clear_cache_(false), |
| 107 waiting_for_clear_cookies_count_(0), | 110 waiting_for_clear_cookies_count_(0), |
| 108 waiting_for_clear_history_(false), | 111 waiting_for_clear_history_(false), |
| 112 waiting_for_clear_local_storage_(false), | |
| 109 waiting_for_clear_networking_history_(false), | 113 waiting_for_clear_networking_history_(false), |
| 110 waiting_for_clear_server_bound_certs_(false), | 114 waiting_for_clear_server_bound_certs_(false), |
| 111 waiting_for_clear_plugin_data_(false), | 115 waiting_for_clear_plugin_data_(false), |
| 112 waiting_for_clear_quota_managed_data_(false), | 116 waiting_for_clear_quota_managed_data_(false), |
| 113 waiting_for_clear_content_licenses_(false), | 117 waiting_for_clear_content_licenses_(false), |
| 114 remove_mask_(0), | 118 remove_mask_(0), |
| 115 remove_origin_(GURL()), | 119 remove_origin_(GURL()), |
| 116 remove_protected_(false) { | 120 origin_set_mask_(0) { |
| 117 DCHECK(profile); | 121 DCHECK(profile); |
| 118 } | 122 } |
| 119 | 123 |
| 120 BrowsingDataRemover::BrowsingDataRemover(Profile* profile, | 124 BrowsingDataRemover::BrowsingDataRemover(Profile* profile, |
| 121 TimePeriod time_period, | 125 TimePeriod time_period, |
| 122 base::Time delete_end) | 126 base::Time delete_end) |
| 123 : profile_(profile), | 127 : profile_(profile), |
| 124 quota_manager_(NULL), | 128 quota_manager_(NULL), |
| 129 dom_storage_context_(NULL), | |
| 125 special_storage_policy_(profile->GetExtensionSpecialStoragePolicy()), | 130 special_storage_policy_(profile->GetExtensionSpecialStoragePolicy()), |
| 126 delete_begin_(CalculateBeginDeleteTime(time_period)), | 131 delete_begin_(CalculateBeginDeleteTime(time_period)), |
| 127 delete_end_(delete_end), | 132 delete_end_(delete_end), |
| 128 next_cache_state_(STATE_NONE), | 133 next_cache_state_(STATE_NONE), |
| 129 cache_(NULL), | 134 cache_(NULL), |
| 130 main_context_getter_(profile->GetRequestContext()), | 135 main_context_getter_(profile->GetRequestContext()), |
| 131 media_context_getter_(profile->GetRequestContextForMedia()), | 136 media_context_getter_(profile->GetRequestContextForMedia()), |
| 132 deauthorize_content_licenses_request_id_(0), | 137 deauthorize_content_licenses_request_id_(0), |
| 133 waiting_for_clear_cache_(false), | 138 waiting_for_clear_cache_(false), |
| 134 waiting_for_clear_cookies_count_(0), | 139 waiting_for_clear_cookies_count_(0), |
| 135 waiting_for_clear_history_(false), | 140 waiting_for_clear_history_(false), |
| 141 waiting_for_clear_local_storage_(false), | |
| 136 waiting_for_clear_networking_history_(false), | 142 waiting_for_clear_networking_history_(false), |
| 137 waiting_for_clear_server_bound_certs_(false), | 143 waiting_for_clear_server_bound_certs_(false), |
| 138 waiting_for_clear_plugin_data_(false), | 144 waiting_for_clear_plugin_data_(false), |
| 139 waiting_for_clear_quota_managed_data_(false), | 145 waiting_for_clear_quota_managed_data_(false), |
| 140 waiting_for_clear_content_licenses_(false), | 146 waiting_for_clear_content_licenses_(false), |
| 141 remove_mask_(0), | 147 remove_mask_(0), |
| 142 remove_origin_(GURL()), | 148 remove_origin_(GURL()), |
| 143 remove_protected_(false) { | 149 origin_set_mask_(0) { |
| 144 DCHECK(profile); | 150 DCHECK(profile); |
| 145 } | 151 } |
| 146 | 152 |
| 147 BrowsingDataRemover::~BrowsingDataRemover() { | 153 BrowsingDataRemover::~BrowsingDataRemover() { |
| 148 DCHECK(all_done()); | 154 DCHECK(all_done()); |
| 149 } | 155 } |
| 150 | 156 |
| 151 // Static. | 157 // Static. |
| 152 void BrowsingDataRemover::set_removing(bool removing) { | 158 void BrowsingDataRemover::set_removing(bool removing) { |
| 153 DCHECK(removing_ != removing); | 159 DCHECK(removing_ != removing); |
| 154 removing_ = removing; | 160 removing_ = removing; |
| 155 } | 161 } |
| 156 | 162 |
| 157 // Static. | 163 // Static. |
| 158 int BrowsingDataRemover::GenerateQuotaClientMask(int remove_mask) { | 164 int BrowsingDataRemover::GenerateQuotaClientMask(int remove_mask) { |
| 159 int quota_client_mask = 0; | 165 int quota_client_mask = 0; |
| 160 if (remove_mask & BrowsingDataRemover::REMOVE_FILE_SYSTEMS) | 166 if (remove_mask & BrowsingDataRemover::REMOVE_FILE_SYSTEMS) |
| 161 quota_client_mask |= quota::QuotaClient::kFileSystem; | 167 quota_client_mask |= quota::QuotaClient::kFileSystem; |
| 162 if (remove_mask & BrowsingDataRemover::REMOVE_WEBSQL) | 168 if (remove_mask & BrowsingDataRemover::REMOVE_WEBSQL) |
| 163 quota_client_mask |= quota::QuotaClient::kDatabase; | 169 quota_client_mask |= quota::QuotaClient::kDatabase; |
| 164 if (remove_mask & BrowsingDataRemover::REMOVE_APPCACHE) | 170 if (remove_mask & BrowsingDataRemover::REMOVE_APPCACHE) |
| 165 quota_client_mask |= quota::QuotaClient::kAppcache; | 171 quota_client_mask |= quota::QuotaClient::kAppcache; |
| 166 if (remove_mask & BrowsingDataRemover::REMOVE_INDEXEDDB) | 172 if (remove_mask & BrowsingDataRemover::REMOVE_INDEXEDDB) |
| 167 quota_client_mask |= quota::QuotaClient::kIndexedDatabase; | 173 quota_client_mask |= quota::QuotaClient::kIndexedDatabase; |
| 168 | 174 |
| 169 return quota_client_mask; | 175 return quota_client_mask; |
| 170 } | 176 } |
| 171 | 177 |
| 172 void BrowsingDataRemover::Remove(int remove_mask) { | 178 void BrowsingDataRemover::Remove(int remove_mask, int origin_set_mask) { |
| 173 RemoveImpl(remove_mask, GURL(), false); | 179 RemoveImpl(remove_mask, GURL(), origin_set_mask); |
| 174 } | 180 } |
| 175 | 181 |
| 176 void BrowsingDataRemover::RemoveImpl(int remove_mask, | 182 void BrowsingDataRemover::RemoveImpl(int remove_mask, |
| 177 const GURL& origin, | 183 const GURL& origin, |
| 178 bool remove_protected_origins) { | 184 int origin_set_mask) { |
| 179 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 185 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 180 set_removing(true); | 186 set_removing(true); |
| 181 remove_mask_ = remove_mask; | 187 remove_mask_ = remove_mask; |
| 182 remove_origin_ = origin; | 188 remove_origin_ = origin; |
| 183 remove_protected_ = remove_protected_origins; | 189 origin_set_mask_ = origin_set_mask; |
| 184 | 190 |
| 185 if (remove_mask & REMOVE_HISTORY) { | 191 if (remove_mask & REMOVE_HISTORY) { |
| 186 HistoryService* history_service = | 192 HistoryService* history_service = |
| 187 profile_->GetHistoryService(Profile::EXPLICIT_ACCESS); | 193 profile_->GetHistoryService(Profile::EXPLICIT_ACCESS); |
| 188 if (history_service) { | 194 if (history_service) { |
| 189 std::set<GURL> restrict_urls; | 195 std::set<GURL> restrict_urls; |
| 190 if (!remove_origin_.is_empty()) | 196 if (!remove_origin_.is_empty()) |
| 191 restrict_urls.insert(remove_origin_); | 197 restrict_urls.insert(remove_origin_); |
| 192 content::RecordAction(UserMetricsAction("ClearBrowsingData_History")); | 198 content::RecordAction(UserMetricsAction("ClearBrowsingData_History")); |
| 193 waiting_for_clear_history_ = true; | 199 waiting_for_clear_history_ = true; |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 304 if (rq_context) { | 310 if (rq_context) { |
| 305 waiting_for_clear_server_bound_certs_ = true; | 311 waiting_for_clear_server_bound_certs_ = true; |
| 306 BrowserThread::PostTask( | 312 BrowserThread::PostTask( |
| 307 BrowserThread::IO, FROM_HERE, | 313 BrowserThread::IO, FROM_HERE, |
| 308 base::Bind(&BrowsingDataRemover::ClearServerBoundCertsOnIOThread, | 314 base::Bind(&BrowsingDataRemover::ClearServerBoundCertsOnIOThread, |
| 309 base::Unretained(this), base::Unretained(rq_context))); | 315 base::Unretained(this), base::Unretained(rq_context))); |
| 310 } | 316 } |
| 311 } | 317 } |
| 312 | 318 |
| 313 if (remove_mask & REMOVE_LOCAL_STORAGE) { | 319 if (remove_mask & REMOVE_LOCAL_STORAGE) { |
| 314 BrowserContext::GetDOMStorageContext(profile_)->DeleteDataModifiedSince( | 320 waiting_for_clear_local_storage_ = true; |
| 315 delete_begin_); | 321 if (!dom_storage_context_) |
| 322 dom_storage_context_ = BrowserContext::GetDOMStorageContext(profile_); | |
| 323 BrowserThread::PostTask( | |
| 324 BrowserThread::IO, FROM_HERE, | |
| 325 base::Bind(&BrowsingDataRemover::ClearLocalStorageOnIOThread, | |
| 326 base::Unretained(this))); | |
| 316 } | 327 } |
| 317 | 328 |
| 318 if (remove_mask & REMOVE_INDEXEDDB || remove_mask & REMOVE_WEBSQL || | 329 if (remove_mask & REMOVE_INDEXEDDB || remove_mask & REMOVE_WEBSQL || |
| 319 remove_mask & REMOVE_APPCACHE || remove_mask & REMOVE_FILE_SYSTEMS) { | 330 remove_mask & REMOVE_APPCACHE || remove_mask & REMOVE_FILE_SYSTEMS) { |
| 320 if (!quota_manager_) | 331 if (!quota_manager_) |
| 321 quota_manager_ = content::BrowserContext::GetQuotaManager(profile_); | 332 quota_manager_ = content::BrowserContext::GetQuotaManager(profile_); |
| 322 waiting_for_clear_quota_managed_data_ = true; | 333 waiting_for_clear_quota_managed_data_ = true; |
| 323 BrowserThread::PostTask( | 334 BrowserThread::PostTask( |
| 324 BrowserThread::IO, FROM_HERE, | 335 BrowserThread::IO, FROM_HERE, |
| 325 base::Bind(&BrowsingDataRemover::ClearQuotaManagedDataOnIOThread, | 336 base::Bind(&BrowsingDataRemover::ClearQuotaManagedDataOnIOThread, |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 589 } | 600 } |
| 590 default: { | 601 default: { |
| 591 NOTREACHED() << "bad state"; | 602 NOTREACHED() << "bad state"; |
| 592 next_cache_state_ = STATE_NONE; // Stop looping. | 603 next_cache_state_ = STATE_NONE; // Stop looping. |
| 593 break; | 604 break; |
| 594 } | 605 } |
| 595 } | 606 } |
| 596 } | 607 } |
| 597 } | 608 } |
| 598 | 609 |
| 610 void BrowsingDataRemover::ClearLocalStorageOnIOThread() { | |
|
michaeln
2012/06/01 20:59:36
it'd be fine to do this directly on the UI thread
| |
| 611 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | |
| 612 DCHECK(waiting_for_clear_local_storage_); | |
| 613 | |
| 614 dom_storage_context_->GetUsageInfo( | |
| 615 base::Bind(&BrowsingDataRemover::OnGotLocalStorageUsageInfo, | |
| 616 base::Unretained(this))); | |
| 617 } | |
| 618 | |
| 619 void BrowsingDataRemover::OnGotLocalStorageUsageInfo( | |
| 620 const std::vector<content::DOMStorageContext::UsageInfo>& infos) { | |
|
michaeln
2012/06/01 20:59:36
fyi: this type is changing in the other interface
| |
| 621 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | |
| 622 DCHECK(waiting_for_clear_local_storage_); | |
| 623 | |
| 624 for (size_t i = 0; i < infos.size(); ++i) { | |
| 625 if (!BrowsingDataHelper::DoesOriginMatchMask(infos[i].origin, | |
| 626 origin_set_mask_, | |
| 627 special_storage_policy_)) | |
| 628 continue; | |
| 629 | |
| 630 if (infos[i].last_modified >= delete_begin_ && | |
| 631 infos[i].last_modified <= delete_end_) | |
| 632 dom_storage_context_->DeleteOrigin(infos[i].origin); | |
| 633 } | |
| 634 BrowserThread::PostTask( | |
| 635 BrowserThread::UI, FROM_HERE, | |
| 636 base::Bind(&BrowsingDataRemover::OnLocalStorageCleared, | |
| 637 base::Unretained(this))); | |
| 638 } | |
| 639 | |
| 640 void BrowsingDataRemover::OnLocalStorageCleared() { | |
| 641 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | |
| 642 DCHECK(waiting_for_clear_local_storage_); | |
| 643 waiting_for_clear_local_storage_ = false; | |
| 644 NotifyAndDeleteIfDone(); | |
| 645 } | |
| 646 | |
| 599 void BrowsingDataRemover::ClearQuotaManagedDataOnIOThread() { | 647 void BrowsingDataRemover::ClearQuotaManagedDataOnIOThread() { |
| 600 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 648 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 601 | 649 |
| 602 // Ask the QuotaManager for all origins with temporary quota modified within | 650 // Ask the QuotaManager for all origins with temporary quota modified within |
| 603 // the user-specified timeframe, and deal with the resulting set in | 651 // the user-specified timeframe, and deal with the resulting set in |
| 604 // OnGotQuotaManagedOrigins(). | 652 // OnGotQuotaManagedOrigins(). |
| 605 quota_managed_origins_to_delete_count_ = 0; | 653 quota_managed_origins_to_delete_count_ = 0; |
| 606 quota_managed_storage_types_to_delete_count_ = 2; | 654 quota_managed_storage_types_to_delete_count_ = 0; |
| 607 | 655 |
| 608 if (delete_begin_ == base::Time()) { | 656 if (delete_begin_ == base::Time() || |
| 609 // If we're deleting since the beginning of time, ask the QuotaManager for | 657 origin_set_mask_ & |
| 610 // all origins with persistent quota modified within the user-specified | 658 (BrowsingDataHelper::PROTECTED_WEB | BrowsingDataHelper::EXTENSION)) { |
| 611 // timeframe, and deal with the resulting set in | 659 // If we're deleting since the beginning of time, or we're removing |
| 612 // OnGotPersistentQuotaManagedOrigins. | 660 // protected origins, then ask the QuotaManager for all origins with |
| 661 // persistent quota modified within the user-specified timeframe, and deal | |
| 662 // with the resulting set in OnGotQuotaManagedOrigins. | |
| 663 ++quota_managed_storage_types_to_delete_count_; | |
| 613 quota_manager_->GetOriginsModifiedSince( | 664 quota_manager_->GetOriginsModifiedSince( |
| 614 quota::kStorageTypePersistent, delete_begin_, | 665 quota::kStorageTypePersistent, delete_begin_, |
| 615 base::Bind(&BrowsingDataRemover::OnGotQuotaManagedOrigins, | 666 base::Bind(&BrowsingDataRemover::OnGotQuotaManagedOrigins, |
| 616 base::Unretained(this))); | 667 base::Unretained(this))); |
| 617 } else { | |
| 618 // Otherwise, we don't need to deal with persistent storage. | |
| 619 --quota_managed_storage_types_to_delete_count_; | |
| 620 } | 668 } |
| 621 | 669 |
| 622 // Do the same for temporary quota, regardless, passing the resulting set into | 670 // Do the same for temporary quota. |
| 623 // OnGotTemporaryQuotaManagedOrigins. | 671 ++quota_managed_storage_types_to_delete_count_; |
| 624 quota_manager_->GetOriginsModifiedSince( | 672 quota_manager_->GetOriginsModifiedSince( |
| 625 quota::kStorageTypeTemporary, delete_begin_, | 673 quota::kStorageTypeTemporary, delete_begin_, |
| 626 base::Bind(&BrowsingDataRemover::OnGotQuotaManagedOrigins, | 674 base::Bind(&BrowsingDataRemover::OnGotQuotaManagedOrigins, |
| 627 base::Unretained(this))); | 675 base::Unretained(this))); |
| 628 } | 676 } |
| 629 | 677 |
| 630 void BrowsingDataRemover::OnGotQuotaManagedOrigins( | 678 void BrowsingDataRemover::OnGotQuotaManagedOrigins( |
| 631 const std::set<GURL>& origins, quota::StorageType type) { | 679 const std::set<GURL>& origins, quota::StorageType type) { |
| 632 DCHECK_GT(quota_managed_storage_types_to_delete_count_, 0); | 680 DCHECK_GT(quota_managed_storage_types_to_delete_count_, 0); |
| 633 // Walk through the origins passed in, delete quota of |type| from each that | 681 // Walk through the origins passed in, delete quota of |type| from each that |
| 634 // isn't protected. | 682 // matches the |origin_set_mask_|. |
| 635 std::set<GURL>::const_iterator origin; | 683 std::set<GURL>::const_iterator origin; |
| 636 for (origin = origins.begin(); origin != origins.end(); ++origin) { | 684 for (origin = origins.begin(); origin != origins.end(); ++origin) { |
| 637 if (!BrowsingDataHelper::IsWebScheme(origin->scheme())) | 685 // TODO(mkwst): Clean this up, it's slow. http://crbug.com/130746 |
|
michaeln
2012/06/01 20:59:36
the bug refers to memory alignment?
Mike West
2012/06/04 06:42:08
No, simpler: If the caller wants to delete all dat
| |
| 638 continue; | |
| 639 if (special_storage_policy_->IsStorageProtected(origin->GetOrigin())) | |
| 640 continue; | |
| 641 if (!remove_origin_.is_empty() && remove_origin_ != origin->GetOrigin()) | 686 if (!remove_origin_.is_empty() && remove_origin_ != origin->GetOrigin()) |
| 642 continue; | 687 continue; |
| 688 | |
| 689 if (!BrowsingDataHelper::DoesOriginMatchMask(origin->GetOrigin(), | |
| 690 origin_set_mask_, | |
| 691 special_storage_policy_)) | |
| 692 continue; | |
| 693 | |
| 643 ++quota_managed_origins_to_delete_count_; | 694 ++quota_managed_origins_to_delete_count_; |
| 644 quota_manager_->DeleteOriginData( | 695 quota_manager_->DeleteOriginData( |
| 645 origin->GetOrigin(), type, | 696 origin->GetOrigin(), type, |
| 646 BrowsingDataRemover::GenerateQuotaClientMask(remove_mask_), | 697 BrowsingDataRemover::GenerateQuotaClientMask(remove_mask_), |
| 647 base::Bind(&BrowsingDataRemover::OnQuotaManagedOriginDeletion, | 698 base::Bind(&BrowsingDataRemover::OnQuotaManagedOriginDeletion, |
| 648 base::Unretained(this))); | 699 base::Unretained(this))); |
| 649 } | 700 } |
| 650 | 701 |
| 651 --quota_managed_storage_types_to_delete_count_; | 702 --quota_managed_storage_types_to_delete_count_; |
| 652 CheckQuotaManagedDataDeletionStatus(); | 703 CheckQuotaManagedDataDeletionStatus(); |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 735 BrowserThread::UI, FROM_HERE, | 786 BrowserThread::UI, FROM_HERE, |
| 736 base::Bind(&BrowsingDataRemover::OnClearedServerBoundCerts, | 787 base::Bind(&BrowsingDataRemover::OnClearedServerBoundCerts, |
| 737 base::Unretained(this))); | 788 base::Unretained(this))); |
| 738 } | 789 } |
| 739 | 790 |
| 740 void BrowsingDataRemover::OnClearedServerBoundCerts() { | 791 void BrowsingDataRemover::OnClearedServerBoundCerts() { |
| 741 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 792 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 742 waiting_for_clear_server_bound_certs_ = false; | 793 waiting_for_clear_server_bound_certs_ = false; |
| 743 NotifyAndDeleteIfDone(); | 794 NotifyAndDeleteIfDone(); |
| 744 } | 795 } |
| OLD | NEW |