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

Unified Diff: chrome/browser/ui/webui/settings/chromeos/device_storage_handler.cc

Issue 2556363003: Refactor cache counting into a separate helper class (Closed)
Patch Set: extract cache_test_util and fixes Created 4 years 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/ui/webui/settings/chromeos/device_storage_handler.cc
diff --git a/chrome/browser/ui/webui/settings/chromeos/device_storage_handler.cc b/chrome/browser/ui/webui/settings/chromeos/device_storage_handler.cc
index 858fab411039767bd1a1bb7e0f9fa1048780573a..4efc3368b3bb498b063096a760c3a88cf064aed8 100644
--- a/chrome/browser/ui/webui/settings/chromeos/device_storage_handler.cc
+++ b/chrome/browser/ui/webui/settings/chromeos/device_storage_handler.cc
@@ -28,7 +28,7 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/grit/generated_resources.h"
#include "chromeos/cryptohome/homedir_methods.h"
-#include "components/browsing_data/content/storage_partition_http_cache_data_remover.h"
+#include "components/browsing_data/content/conditional_cache_counting_helper.h"
#include "components/drive/chromeos/file_system_interface.h"
#include "components/user_manager/user_manager.h"
#include "content/public/browser/browser_context.h"
@@ -233,10 +233,10 @@ void StorageHandler::UpdateBrowsingDataSize() {
Profile* const profile = Profile::FromWebUI(web_ui());
// Fetch the size of http cache in browsing data.
// StoragePartitionHttpCacheDataRemover deletes itself when it is done.
- browsing_data::StoragePartitionHttpCacheDataRemover::CreateForRange(
+ browsing_data::ConditionalCacheCountingHelper::CreateForRange(
content::BrowserContext::GetDefaultStoragePartition(profile),
- base::Time(),
- base::Time::Max())->Count(
+ base::Time(), base::Time::Max())
+ ->CountAndDestroySelfWhenFinished(
base::Bind(&StorageHandler::OnGetBrowsingDataSize,
base::Unretained(this), false));

Powered by Google App Engine
This is Rietveld 408576698