Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef COMPONENTS_OFFLINE_PAGES_ARCHIVE_MANAGER_H_ | 5 #ifndef COMPONENTS_OFFLINE_PAGES_ARCHIVE_MANAGER_H_ |
| 6 #define COMPONENTS_OFFLINE_PAGES_ARCHIVE_MANAGER_H_ | 6 #define COMPONENTS_OFFLINE_PAGES_ARCHIVE_MANAGER_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 40 const base::Callback<void(bool)>& callback); | 40 const base::Callback<void(bool)>& callback); |
| 41 | 41 |
| 42 // Deletes an archive with specified |archive_path|. | 42 // Deletes an archive with specified |archive_path|. |
| 43 // It is considered successful to attempt to delete a file that does not | 43 // It is considered successful to attempt to delete a file that does not |
| 44 // exist. | 44 // exist. |
| 45 virtual void DeleteArchive(const base::FilePath& archive_path, | 45 virtual void DeleteArchive(const base::FilePath& archive_path, |
| 46 const base::Callback<void(bool)>& callback); | 46 const base::Callback<void(bool)>& callback); |
| 47 | 47 |
| 48 // Deletes multiple archives that are specified in |archive_paths|. | 48 // Deletes multiple archives that are specified in |archive_paths|. |
| 49 // It is considered successful to attempt to delete a file that does not | 49 // It is considered successful to attempt to delete a file that does not |
| 50 // exist. | 50 // exist, or |archive_path| is empty. |
|
jianli
2016/05/26 21:59:31
Adding this behavior seems to be confusing.
romax
2016/05/27 00:41:37
removed
| |
| 51 virtual void DeleteMultipleArchives( | 51 virtual void DeleteMultipleArchives( |
| 52 const std::vector<base::FilePath>& archive_paths, | 52 const std::vector<base::FilePath>& archive_paths, |
| 53 const base::Callback<void(bool)>& callback); | 53 const base::Callback<void(bool)>& callback); |
| 54 | 54 |
| 55 // Lists all archive files in the archive directory. | 55 // Lists all archive files in the archive directory. |
| 56 virtual void GetAllArchives( | 56 virtual void GetAllArchives( |
| 57 const base::Callback<void(const std::set<base::FilePath>&)>& callback) | 57 const base::Callback<void(const std::set<base::FilePath>&)>& callback) |
| 58 const; | 58 const; |
| 59 | 59 |
| 60 // Gets stats about archive storage, i.e. total archive sizes and free disk | 60 // Gets stats about archive storage, i.e. total archive sizes and free disk |
| 61 // space. | 61 // space. |
| 62 virtual void GetStorageStats( | 62 virtual void GetStorageStats( |
| 63 const base::Callback<void(const StorageStats& storage_sizes)>& callback) | 63 const base::Callback<void(const StorageStats& storage_sizes)>& callback) |
| 64 const; | 64 const; |
| 65 | 65 |
| 66 protected: | 66 protected: |
| 67 ArchiveManager(); | 67 ArchiveManager(); |
| 68 | 68 |
| 69 private: | 69 private: |
| 70 // Path under which all of the managed archives should be stored. | 70 // Path under which all of the managed archives should be stored. |
| 71 base::FilePath archives_dir_; | 71 base::FilePath archives_dir_; |
| 72 // Task runner for running file operations. | 72 // Task runner for running file operations. |
| 73 scoped_refptr<base::SequencedTaskRunner> task_runner_; | 73 scoped_refptr<base::SequencedTaskRunner> task_runner_; |
| 74 }; | 74 }; |
| 75 | 75 |
| 76 } // namespace offline_pages | 76 } // namespace offline_pages |
| 77 | 77 |
| 78 #endif // COMPONENTS_OFFLINE_PAGES_ARCHIVE_MANAGER_H_ | 78 #endif // COMPONENTS_OFFLINE_PAGES_ARCHIVE_MANAGER_H_ |
| OLD | NEW |