| 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 of the cache. | 5 // See net/disk_cache/disk_cache.h for the public interface of the cache. |
| 6 | 6 |
| 7 #ifndef NET_DISK_CACHE_MAPPED_FILE_H_ | 7 #ifndef NET_DISK_CACHE_BLOCKFILE_MAPPED_FILE_H_ |
| 8 #define NET_DISK_CACHE_MAPPED_FILE_H_ | 8 #define NET_DISK_CACHE_BLOCKFILE_MAPPED_FILE_H_ |
| 9 | 9 |
| 10 #include "net/base/net_export.h" | 10 #include "net/base/net_export.h" |
| 11 #include "net/disk_cache/file.h" | 11 #include "net/disk_cache/blockfile/file.h" |
| 12 #include "net/disk_cache/file_block.h" | 12 #include "net/disk_cache/blockfile/file_block.h" |
| 13 | 13 |
| 14 namespace base { | 14 namespace base { |
| 15 class FilePath; | 15 class FilePath; |
| 16 } | 16 } |
| 17 | 17 |
| 18 namespace disk_cache { | 18 namespace disk_cache { |
| 19 | 19 |
| 20 // This class implements a memory mapped file used to access block-files. The | 20 // This class implements a memory mapped file used to access block-files. The |
| 21 // idea is that the header and bitmap will be memory mapped all the time, and | 21 // idea is that the header and bitmap will be memory mapped all the time, and |
| 22 // the actual data for the blocks will be access asynchronously (most of the | 22 // the actual data for the blocks will be access asynchronously (most of the |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 explicit ScopedFlush(MappedFile* file) : file_(file) {} | 68 explicit ScopedFlush(MappedFile* file) : file_(file) {} |
| 69 ~ScopedFlush() { | 69 ~ScopedFlush() { |
| 70 file_->Flush(); | 70 file_->Flush(); |
| 71 } | 71 } |
| 72 private: | 72 private: |
| 73 MappedFile* file_; | 73 MappedFile* file_; |
| 74 }; | 74 }; |
| 75 | 75 |
| 76 } // namespace disk_cache | 76 } // namespace disk_cache |
| 77 | 77 |
| 78 #endif // NET_DISK_CACHE_MAPPED_FILE_H_ | 78 #endif // NET_DISK_CACHE_BLOCKFILE_MAPPED_FILE_H_ |
| OLD | NEW |