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

Unified Diff: chrome/browser/ui/webui/options/chromeos/storage_manager_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/options/chromeos/storage_manager_handler.cc
diff --git a/chrome/browser/ui/webui/options/chromeos/storage_manager_handler.cc b/chrome/browser/ui/webui/options/chromeos/storage_manager_handler.cc
index dba9a9350018cf60a0529038b768107b4689dea5..fdc6102325205d580412fa7ff98d304658f1b3ee 100644
--- a/chrome/browser/ui/webui/options/chromeos/storage_manager_handler.cc
+++ b/chrome/browser/ui/webui/options/chromeos/storage_manager_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"
@@ -301,10 +301,10 @@ void StorageManagerHandler::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(&StorageManagerHandler::OnGetBrowsingDataSize,
weak_ptr_factory_.GetWeakPtr(), false));

Powered by Google App Engine
This is Rietveld 408576698