diff options
author | tzik@chromium.org <tzik@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-03 06:00:12 +0000 |
---|---|---|
committer | tzik@chromium.org <tzik@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-03 06:00:12 +0000 |
commit | 7b96328ff9e87f31aaf6413088f0290cb5a57ead (patch) | |
tree | ec4b21e58513332c6a34f7222b25e83286a1cd91 /chrome/browser/browsing_data_quota_helper_impl.cc | |
parent | ee4bbe6e009eaa5f5268e1dbfe71fbab3b50583b (diff) | |
download | chromium_src-7b96328ff9e87f31aaf6413088f0290cb5a57ead.zip chromium_src-7b96328ff9e87f31aaf6413088f0290cb5a57ead.tar.gz chromium_src-7b96328ff9e87f31aaf6413088f0290cb5a57ead.tar.bz2 |
Revoke quota when cookies tree item was deleted.
BUG=94862
TEST='BrowsingDataQuotaHelperTest.*'
Review URL: http://codereview.chromium.org/7810022
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@103686 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browsing_data_quota_helper_impl.cc')
-rw-r--r-- | chrome/browser/browsing_data_quota_helper_impl.cc | 53 |
1 files changed, 38 insertions, 15 deletions
diff --git a/chrome/browser/browsing_data_quota_helper_impl.cc b/chrome/browser/browsing_data_quota_helper_impl.cc index bb4e9da..4ca148e 100644 --- a/chrome/browser/browsing_data_quota_helper_impl.cc +++ b/chrome/browser/browsing_data_quota_helper_impl.cc @@ -19,21 +19,6 @@ BrowsingDataQuotaHelper* BrowsingDataQuotaHelper::Create(Profile* profile) { profile->GetQuotaManager()); } -BrowsingDataQuotaHelperImpl::BrowsingDataQuotaHelperImpl( - base::MessageLoopProxy* ui_thread, - base::MessageLoopProxy* io_thread, - quota::QuotaManager* quota_manager) - : BrowsingDataQuotaHelper(io_thread), - quota_manager_(quota_manager), - is_fetching_(false), - ui_thread_(ui_thread), - io_thread_(io_thread), - callback_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { - DCHECK(quota_manager); -} - -BrowsingDataQuotaHelperImpl::~BrowsingDataQuotaHelperImpl() {} - void BrowsingDataQuotaHelperImpl::StartFetching(FetchResultCallback* callback) { DCHECK(callback); DCHECK(!callback_.get()); @@ -49,6 +34,37 @@ void BrowsingDataQuotaHelperImpl::CancelNotification() { callback_.reset(); } +void BrowsingDataQuotaHelperImpl::RevokeHostQuota(const std::string& host) { + if (!io_thread_->BelongsToCurrentThread()) { + io_thread_->PostTask( + FROM_HERE, + NewRunnableMethod( + this, + &BrowsingDataQuotaHelperImpl::RevokeHostQuota, + host)); + return; + } + + quota_manager_->SetPersistentHostQuota( + host, 0, callback_factory_.NewCallback( + &BrowsingDataQuotaHelperImpl::DidRevokeHostQuota)); +} + +BrowsingDataQuotaHelperImpl::BrowsingDataQuotaHelperImpl( + base::MessageLoopProxy* ui_thread, + base::MessageLoopProxy* io_thread, + quota::QuotaManager* quota_manager) + : BrowsingDataQuotaHelper(io_thread), + quota_manager_(quota_manager), + is_fetching_(false), + ui_thread_(ui_thread), + io_thread_(io_thread), + callback_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { + DCHECK(quota_manager); +} + +BrowsingDataQuotaHelperImpl::~BrowsingDataQuotaHelperImpl() {} + void BrowsingDataQuotaHelperImpl::FetchQuotaInfo() { if (!io_thread_->BelongsToCurrentThread()) { io_thread_->PostTask( @@ -160,3 +176,10 @@ void BrowsingDataQuotaHelperImpl::OnComplete() { callback_->Run(result); callback_.reset(); } + +void BrowsingDataQuotaHelperImpl::DidRevokeHostQuota( + quota::QuotaStatusCode status_unused, + const std::string& host_unused, + quota::StorageType type_unused, + int64 quota_unused) { +} |