| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_BLOCK_FILES_H__ | 7 #ifndef NET_DISK_CACHE_BLOCK_FILES_H__ |
| 8 #define NET_DISK_CACHE_BLOCK_FILES_H__ | 8 #define NET_DISK_CACHE_BLOCK_FILES_H__ |
| 9 #pragma once | 9 #pragma once |
| 10 | 10 |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/file_path.h" | 13 #include "base/file_path.h" |
| 14 #include "base/gtest_prod_util.h" | 14 #include "base/gtest_prod_util.h" |
| 15 #include "net/disk_cache/addr.h" | 15 #include "net/disk_cache/addr.h" |
| 16 #include "net/disk_cache/mapped_file.h" | 16 #include "net/disk_cache/mapped_file.h" |
| 17 | 17 |
| 18 namespace disk_cache { | 18 namespace disk_cache { |
| 19 | 19 |
| 20 class EntryImpl; | |
| 21 | |
| 22 // This class handles the set of block-files open by the disk cache. | 20 // This class handles the set of block-files open by the disk cache. |
| 23 class BlockFiles { | 21 class BlockFiles { |
| 24 public: | 22 public: |
| 25 explicit BlockFiles(const FilePath& path) | 23 explicit BlockFiles(const FilePath& path) |
| 26 : init_(false), zero_buffer_(NULL), path_(path) {} | 24 : init_(false), zero_buffer_(NULL), path_(path) {} |
| 27 ~BlockFiles(); | 25 ~BlockFiles(); |
| 28 | 26 |
| 29 // Performs the object initialization. create_files indicates if the backing | 27 // Performs the object initialization. create_files indicates if the backing |
| 30 // files should be created or just open. | 28 // files should be created or just open. |
| 31 bool Init(bool create_files); | 29 bool Init(bool create_files); |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 FRIEND_TEST_ALL_PREFIXES(DiskCacheTest, BlockFiles_ZeroSizeFile); | 85 FRIEND_TEST_ALL_PREFIXES(DiskCacheTest, BlockFiles_ZeroSizeFile); |
| 88 FRIEND_TEST_ALL_PREFIXES(DiskCacheTest, BlockFiles_InvalidFile); | 86 FRIEND_TEST_ALL_PREFIXES(DiskCacheTest, BlockFiles_InvalidFile); |
| 89 FRIEND_TEST_ALL_PREFIXES(DiskCacheTest, BlockFiles_Stats); | 87 FRIEND_TEST_ALL_PREFIXES(DiskCacheTest, BlockFiles_Stats); |
| 90 | 88 |
| 91 DISALLOW_COPY_AND_ASSIGN(BlockFiles); | 89 DISALLOW_COPY_AND_ASSIGN(BlockFiles); |
| 92 }; | 90 }; |
| 93 | 91 |
| 94 } // namespace disk_cache | 92 } // namespace disk_cache |
| 95 | 93 |
| 96 #endif // NET_DISK_CACHE_BLOCK_FILES_H__ | 94 #endif // NET_DISK_CACHE_BLOCK_FILES_H__ |
| OLD | NEW |