| 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 #include "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/callback.h" | 6 #include "base/callback.h" |
| 7 #include "base/files/file_enumerator.h" | 7 #include "base/files/file_enumerator.h" |
| 8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
| 9 #include "base/location.h" | 9 #include "base/location.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "base/sequenced_task_runner.h" | 12 #include "base/sequenced_task_runner.h" |
| 13 #include "base/sys_info.h" | 13 #include "base/sys_info.h" |
| 14 #include "base/threading/thread_task_runner_handle.h" | 14 #include "base/threading/thread_task_runner_handle.h" |
| 15 #include "components/offline_pages/archive_manager.h" | 15 #include "components/offline_pages/core/archive_manager.h" |
| 16 | 16 |
| 17 namespace offline_pages { | 17 namespace offline_pages { |
| 18 | 18 |
| 19 namespace { | 19 namespace { |
| 20 | 20 |
| 21 using StorageStatsCallback = | 21 using StorageStatsCallback = |
| 22 base::Callback<void(const ArchiveManager::StorageStats& storage_stats)>; | 22 base::Callback<void(const ArchiveManager::StorageStats& storage_stats)>; |
| 23 | 23 |
| 24 void EnsureArchivesDirCreatedImpl(const base::FilePath& archives_dir) { | 24 void EnsureArchivesDirCreatedImpl(const base::FilePath& archives_dir) { |
| 25 CHECK(base::CreateDirectory(archives_dir)); | 25 CHECK(base::CreateDirectory(archives_dir)); |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 } | 115 } |
| 116 | 116 |
| 117 void ArchiveManager::GetStorageStats( | 117 void ArchiveManager::GetStorageStats( |
| 118 const StorageStatsCallback& callback) const { | 118 const StorageStatsCallback& callback) const { |
| 119 task_runner_->PostTask( | 119 task_runner_->PostTask( |
| 120 FROM_HERE, base::Bind(GetStorageStatsImpl, archives_dir_, | 120 FROM_HERE, base::Bind(GetStorageStatsImpl, archives_dir_, |
| 121 base::ThreadTaskRunnerHandle::Get(), callback)); | 121 base::ThreadTaskRunnerHandle::Get(), callback)); |
| 122 } | 122 } |
| 123 | 123 |
| 124 } // namespace offline_pages | 124 } // namespace offline_pages |
| OLD | NEW |