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 <vector> | 9 #include <vector> |
| 9 | 10 |
| 10 #include "base/callback_forward.h" | 11 #include "base/callback_forward.h" |
| 11 #include "base/files/file_path.h" | 12 #include "base/files/file_path.h" |
| 12 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 13 | 14 |
| 14 namespace base { | 15 namespace base { |
| 15 class SequencedTaskRunner; | 16 class SequencedTaskRunner; |
| 16 } // namespace base | 17 } // namespace base |
| 17 | 18 |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 39 virtual void DeleteArchive(const base::FilePath& archive_path, | 40 virtual void DeleteArchive(const base::FilePath& archive_path, |
| 40 const base::Callback<void(bool)>& callback); | 41 const base::Callback<void(bool)>& callback); |
| 41 | 42 |
| 42 // Deletes multiple archives that are specified in |archive_paths|. | 43 // Deletes multiple archives that are specified in |archive_paths|. |
| 43 // It is considered successful to attempt to delete a file that does not | 44 // It is considered successful to attempt to delete a file that does not |
| 44 // exist. | 45 // exist. |
| 45 virtual void DeleteMultipleArchives( | 46 virtual void DeleteMultipleArchives( |
| 46 const std::vector<base::FilePath>& archive_paths, | 47 const std::vector<base::FilePath>& archive_paths, |
| 47 const base::Callback<void(bool)>& callback); | 48 const base::Callback<void(bool)>& callback); |
| 48 | 49 |
| 50 // Lists all files int the archives in the archive directory. | |
|
jianli
2016/05/17 21:48:13
nit: typo for int.
Simpler to say: // Retrieves a
fgorski
2016/05/17 22:50:29
Done.
| |
| 51 virtual void GetAllArchives( | |
| 52 const base::Callback<void(const std::set<base::FilePath>& )>& callback) | |
| 53 const; | |
| 54 | |
| 49 private: | 55 private: |
| 50 // Path under which all of the managed archives should be stored. | 56 // Path under which all of the managed archives should be stored. |
| 51 base::FilePath archives_dir_; | 57 base::FilePath archives_dir_; |
| 52 // Task runner for running file operations. | 58 // Task runner for running file operations. |
| 53 scoped_refptr<base::SequencedTaskRunner> task_runner_; | 59 scoped_refptr<base::SequencedTaskRunner> task_runner_; |
| 54 }; | 60 }; |
| 55 | 61 |
| 56 } // namespace offline_pages | 62 } // namespace offline_pages |
| 57 | 63 |
| 58 #endif // COMPONENTS_OFFLINE_PAGES_ARCHIVE_MANAGER_H_ | 64 #endif // COMPONENTS_OFFLINE_PAGES_ARCHIVE_MANAGER_H_ |
| OLD | NEW |