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, |