Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(195)

Unified Diff: chrome/browser/browsing_data_quota_helper_impl.cc

Issue 8070001: Use base::Callback in Quota related code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/browsing_data_quota_helper_impl.cc
diff --git a/chrome/browser/browsing_data_quota_helper_impl.cc b/chrome/browser/browsing_data_quota_helper_impl.cc
index 4ca148e856af49a850923b556315f48c700bad4e..4c1ce266e37ae27cbc7226662d3fb0a27be5617b 100644
--- a/chrome/browser/browsing_data_quota_helper_impl.cc
+++ b/chrome/browser/browsing_data_quota_helper_impl.cc
@@ -7,6 +7,7 @@
#include <map>
#include <set>
+#include "base/bind.h"
#include "base/logging.h"
#include "chrome/browser/profiles/profile.h"
#include "webkit/quota/quota_manager.h"
@@ -46,8 +47,9 @@ void BrowsingDataQuotaHelperImpl::RevokeHostQuota(const std::string& host) {
}
quota_manager_->SetPersistentHostQuota(
- host, 0, callback_factory_.NewCallback(
- &BrowsingDataQuotaHelperImpl::DidRevokeHostQuota));
+ host, 0,
+ base::Bind(&BrowsingDataQuotaHelperImpl::DidRevokeHostQuota,
+ weak_factory_.GetWeakPtr()));
}
BrowsingDataQuotaHelperImpl::BrowsingDataQuotaHelperImpl(
@@ -59,7 +61,7 @@ BrowsingDataQuotaHelperImpl::BrowsingDataQuotaHelperImpl(
is_fetching_(false),
ui_thread_(ui_thread),
io_thread_(io_thread),
- callback_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) {
+ weak_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) {
DCHECK(quota_manager);
}
@@ -78,8 +80,8 @@ void BrowsingDataQuotaHelperImpl::FetchQuotaInfo() {
quota_manager_->GetOriginsModifiedSince(
quota::kStorageTypeTemporary,
base::Time(),
- callback_factory_.NewCallback(
- &BrowsingDataQuotaHelperImpl::GotOrigins));
+ base::Bind(&BrowsingDataQuotaHelperImpl::GotOrigins,
+ weak_factory_.GetWeakPtr()));
}
void BrowsingDataQuotaHelperImpl::GotOrigins(
@@ -96,8 +98,8 @@ void BrowsingDataQuotaHelperImpl::GotOrigins(
quota_manager_->GetOriginsModifiedSince(
quota::kStorageTypePersistent,
base::Time(),
- callback_factory_.NewCallback(
- &BrowsingDataQuotaHelperImpl::GotOrigins));
+ base::Bind(&BrowsingDataQuotaHelperImpl::GotOrigins,
+ weak_factory_.GetWeakPtr()));
} else {
// type == quota::kStorageTypePersistent
ProcessPendingHosts();
@@ -122,8 +124,8 @@ void BrowsingDataQuotaHelperImpl::GetHostUsage(const std::string& host,
DCHECK(quota_manager_.get());
quota_manager_->GetHostUsage(
host, type,
- callback_factory_.NewCallback(
- &BrowsingDataQuotaHelperImpl::GotHostUsage));
+ base::Bind(&BrowsingDataQuotaHelperImpl::GotHostUsage,
+ weak_factory_.GetWeakPtr()));
}
void BrowsingDataQuotaHelperImpl::GotHostUsage(const std::string& host,
« no previous file with comments | « chrome/browser/browsing_data_quota_helper_impl.h ('k') | chrome/browser/browsing_data_quota_helper_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698