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

Unified Diff: webkit/quota/quota_temporary_storage_evictor.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: webkit/quota/quota_temporary_storage_evictor.cc
diff --git a/webkit/quota/quota_temporary_storage_evictor.cc b/webkit/quota/quota_temporary_storage_evictor.cc
index 0e919f61f7fd0c04710ae20f14421ebddba4a5a6..30bac6d8de37647c7bbd9448e6a0e2525b11f265 100644
--- a/webkit/quota/quota_temporary_storage_evictor.cc
+++ b/webkit/quota/quota_temporary_storage_evictor.cc
@@ -4,6 +4,8 @@
#include "webkit/quota/quota_temporary_storage_evictor.h"
+#include <algorithm>
+
#include "base/bind.h"
#include "base/metrics/histogram.h"
#include "googleurl/src/gurl.h"
@@ -41,7 +43,6 @@ QuotaTemporaryStorageEvictor::QuotaTemporaryStorageEvictor(
quota_eviction_handler_(quota_eviction_handler),
interval_ms_(interval_ms),
repeated_eviction_(true),
- callback_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)),
weak_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) {
DCHECK(quota_eviction_handler);
}
@@ -218,8 +219,9 @@ void QuotaTemporaryStorageEvictor::OnGotLRUOrigin(const GURL& origin) {
}
quota_eviction_handler_->EvictOriginData(origin, kStorageTypeTemporary,
- callback_factory_.NewCallback(
- &QuotaTemporaryStorageEvictor::OnEvictionComplete));
+ base::Bind(
+ &QuotaTemporaryStorageEvictor::OnEvictionComplete,
+ weak_factory_.GetWeakPtr()));
}
void QuotaTemporaryStorageEvictor::OnEvictionComplete(
« no previous file with comments | « webkit/quota/quota_temporary_storage_evictor.h ('k') | webkit/quota/quota_temporary_storage_evictor_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698