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

Unified Diff: chrome/browser/browsing_data/cache_counter.cc

Issue 2084903002: Moved BrowsingDataCounter and part of BrowsingDataCounterUtils to components. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 5 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/cache_counter.cc
diff --git a/chrome/browser/browsing_data/cache_counter.cc b/chrome/browser/browsing_data/cache_counter.cc
index 8993563ac87e7b5538fb8a7255103ac94365035c..ac72816df611f7c79fc99ca08ca5c94e8d61baab 100644
--- a/chrome/browser/browsing_data/cache_counter.cc
+++ b/chrome/browser/browsing_data/cache_counter.cc
@@ -3,22 +3,20 @@
// found in the LICENSE file.
#include "chrome/browser/browsing_data/cache_counter.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/common/pref_names.h"
#include "components/browsing_data/storage_partition_http_cache_data_remover.h"
#include "net/base/net_errors.h"
-CacheCounter::CacheCounter() : pref_name_(prefs::kDeleteCache),
- pending_(false),
- weak_ptr_factory_(this) {
-}
+CacheCounter::CacheCounter(Profile* profile)
+ : BrowsingDataCounter(prefs::kDeleteCache),
+ profile_(profile),
+ pending_(false),
+ weak_ptr_factory_(this) {}
CacheCounter::~CacheCounter() {
}
-const std::string& CacheCounter::GetPrefName() const {
- return pref_name_;
-}
-
void CacheCounter::Count() {
// TODO(msramek): StoragePartitionHttpCacheDataRemover currently does not
// implement counting for subsets of cache, only for the entire cache. Thus,
@@ -26,11 +24,10 @@ void CacheCounter::Count() {
// the unbounded time interval. It is up to the UI to interpret the results
// for finite time intervals as upper estimates.
browsing_data::StoragePartitionHttpCacheDataRemover::CreateForRange(
- content::BrowserContext::GetDefaultStoragePartition(GetProfile()),
- base::Time(),
- base::Time::Max())->Count(
- base::Bind(&CacheCounter::OnCacheSizeCalculated,
- weak_ptr_factory_.GetWeakPtr()));
+ content::BrowserContext::GetDefaultStoragePartition(profile_),
+ base::Time(), base::Time::Max())
+ ->Count(base::Bind(&CacheCounter::OnCacheSizeCalculated,
+ weak_ptr_factory_.GetWeakPtr()));
pending_ = true;
}
« no previous file with comments | « chrome/browser/browsing_data/cache_counter.h ('k') | chrome/browser/browsing_data/cache_counter_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698