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

Unified Diff: components/offline_pages/archive_manager.h

Issue 1988973002: [Offline pages] Moving disk size related calls to Archive Manager, reorganizing UMA (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@archive-manager
Patch Set: Adding test, updating ArchiveManager implementation to task runner. Created 4 years, 7 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: components/offline_pages/archive_manager.h
diff --git a/components/offline_pages/archive_manager.h b/components/offline_pages/archive_manager.h
index 6441d85fdc82ffe85c3641bd0e1037883d728bbf..7220042d00ad1bcbc1b858ac5cbf25fda883868c 100644
--- a/components/offline_pages/archive_manager.h
+++ b/components/offline_pages/archive_manager.h
@@ -23,6 +23,13 @@ namespace offline_pages {
// All tasks are performed using |task_runner_|.
class ArchiveManager {
public:
+ // Structure for passing around information related to disk space consumed by
jianli 2016/05/18 00:06:00 nit: no need to comment since struct name should b
fgorski 2016/05/18 18:14:59 Done.
+ // offline page archives.
+ struct StorageSizes {
jianli 2016/05/18 00:05:59 nit: StorageStats
fgorski 2016/05/18 18:14:59 Done.
+ int64_t free_disk_space;
+ int64_t total_archives_size;
+ };
+
ArchiveManager(const base::FilePath& archives_dir,
const scoped_refptr<base::SequencedTaskRunner>& task_runner);
virtual ~ArchiveManager();
@@ -52,6 +59,11 @@ class ArchiveManager {
const base::Callback<void(const std::set<base::FilePath>&)>& callback)
const;
+ // Gets information about disk space consumed by offline archives and disk
+ // space available, for UMA reporting.
jianli 2016/05/18 00:06:00 nit: remove UMA reporting in case we might use thi
fgorski 2016/05/18 18:14:59 Done.
+ virtual void GetStorageSizes(
jianli 2016/05/18 00:05:59 nit: GetStorageStats
fgorski 2016/05/18 18:14:59 Done.
+ const base::Callback<void(StorageSizes storage_sizes)>& callback) const;
+
private:
// Path under which all of the managed archives should be stored.
base::FilePath archives_dir_;

Powered by Google App Engine
This is Rietveld 408576698