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

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: pass as cref, and fix style. 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 bb4e9dacd007a1317b9d8ab82a19ca9ddf64d83d..4522e9c9daea68c47393c60781e24ba5797d56e3 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"
@@ -28,7 +29,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);
}
@@ -62,8 +63,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(
@@ -80,8 +81,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();
@@ -106,8 +107,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,

Powered by Google App Engine
This is Rietveld 408576698