| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // See net/disk_cache/disk_cache.h for the public interface. | 5 // See net/disk_cache/disk_cache.h for the public interface. |
| 6 | 6 |
| 7 #ifndef NET_DISK_CACHE_BLOCKFILE_BLOCK_FILES_H_ | 7 #ifndef NET_DISK_CACHE_BLOCKFILE_BLOCK_FILES_H_ |
| 8 #define NET_DISK_CACHE_BLOCKFILE_BLOCK_FILES_H_ | 8 #define NET_DISK_CACHE_BLOCKFILE_BLOCK_FILES_H_ |
| 9 | 9 |
| 10 #include <stdint.h> | 10 #include <stdint.h> |
| 11 | 11 |
| 12 #include <memory> |
| 12 #include <vector> | 13 #include <vector> |
| 13 | 14 |
| 14 #include "base/files/file_path.h" | 15 #include "base/files/file_path.h" |
| 15 #include "base/gtest_prod_util.h" | 16 #include "base/gtest_prod_util.h" |
| 16 #include "base/macros.h" | 17 #include "base/macros.h" |
| 17 #include "base/memory/scoped_ptr.h" | |
| 18 #include "net/base/net_export.h" | 18 #include "net/base/net_export.h" |
| 19 #include "net/disk_cache/blockfile/addr.h" | 19 #include "net/disk_cache/blockfile/addr.h" |
| 20 #include "net/disk_cache/blockfile/disk_format_base.h" | 20 #include "net/disk_cache/blockfile/disk_format_base.h" |
| 21 #include "net/disk_cache/blockfile/mapped_file.h" | 21 #include "net/disk_cache/blockfile/mapped_file.h" |
| 22 | 22 |
| 23 namespace base { | 23 namespace base { |
| 24 class ThreadChecker; | 24 class ThreadChecker; |
| 25 } | 25 } |
| 26 | 26 |
| 27 namespace disk_cache { | 27 namespace disk_cache { |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 // Retrieves stats for the given file index. | 150 // Retrieves stats for the given file index. |
| 151 void GetFileStats(int index, int* used_count, int* load); | 151 void GetFileStats(int index, int* used_count, int* load); |
| 152 | 152 |
| 153 // Returns the filename for a given file index. | 153 // Returns the filename for a given file index. |
| 154 base::FilePath Name(int index); | 154 base::FilePath Name(int index); |
| 155 | 155 |
| 156 bool init_; | 156 bool init_; |
| 157 char* zero_buffer_; // Buffer to speed-up cleaning deleted entries. | 157 char* zero_buffer_; // Buffer to speed-up cleaning deleted entries. |
| 158 base::FilePath path_; // Path to the backing folder. | 158 base::FilePath path_; // Path to the backing folder. |
| 159 std::vector<MappedFile*> block_files_; // The actual files. | 159 std::vector<MappedFile*> block_files_; // The actual files. |
| 160 scoped_ptr<base::ThreadChecker> thread_checker_; | 160 std::unique_ptr<base::ThreadChecker> thread_checker_; |
| 161 | 161 |
| 162 FRIEND_TEST_ALL_PREFIXES(DiskCacheTest, BlockFiles_ZeroSizeFile); | 162 FRIEND_TEST_ALL_PREFIXES(DiskCacheTest, BlockFiles_ZeroSizeFile); |
| 163 FRIEND_TEST_ALL_PREFIXES(DiskCacheTest, BlockFiles_TruncatedFile); | 163 FRIEND_TEST_ALL_PREFIXES(DiskCacheTest, BlockFiles_TruncatedFile); |
| 164 FRIEND_TEST_ALL_PREFIXES(DiskCacheTest, BlockFiles_InvalidFile); | 164 FRIEND_TEST_ALL_PREFIXES(DiskCacheTest, BlockFiles_InvalidFile); |
| 165 FRIEND_TEST_ALL_PREFIXES(DiskCacheTest, BlockFiles_Stats); | 165 FRIEND_TEST_ALL_PREFIXES(DiskCacheTest, BlockFiles_Stats); |
| 166 | 166 |
| 167 DISALLOW_COPY_AND_ASSIGN(BlockFiles); | 167 DISALLOW_COPY_AND_ASSIGN(BlockFiles); |
| 168 }; | 168 }; |
| 169 | 169 |
| 170 } // namespace disk_cache | 170 } // namespace disk_cache |
| 171 | 171 |
| 172 #endif // NET_DISK_CACHE_BLOCKFILE_BLOCK_FILES_H_ | 172 #endif // NET_DISK_CACHE_BLOCKFILE_BLOCK_FILES_H_ |
| OLD | NEW |