| 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_STORAGE_BLOCK_H__ | 7 #ifndef NET_DISK_CACHE_STORAGE_BLOCK_H__ |
| 8 #define NET_DISK_CACHE_STORAGE_BLOCK_H__ | 8 #define NET_DISK_CACHE_STORAGE_BLOCK_H__ |
| 9 #pragma once | 9 #pragma once |
| 10 | 10 |
| 11 #include "net/disk_cache/addr.h" | 11 #include "net/disk_cache/addr.h" |
| 12 #include "net/disk_cache/mapped_file.h" | 12 #include "net/disk_cache/mapped_file.h" |
| 13 | 13 |
| 14 namespace disk_cache { | 14 namespace disk_cache { |
| 15 | 15 |
| 16 class EntryImpl; | |
| 17 | |
| 18 // This class encapsulates common behavior of a single "block" of data that is | 16 // This class encapsulates common behavior of a single "block" of data that is |
| 19 // stored on a block-file. It implements the FileBlock interface, so it can be | 17 // stored on a block-file. It implements the FileBlock interface, so it can be |
| 20 // serialized directly to the backing file. | 18 // serialized directly to the backing file. |
| 21 // This object provides a memory buffer for the related data, and it can be used | 19 // This object provides a memory buffer for the related data, and it can be used |
| 22 // to actually share that memory with another instance of the class. | 20 // to actually share that memory with another instance of the class. |
| 23 // | 21 // |
| 24 // The following example shows how to share storage with another object: | 22 // The following example shows how to share storage with another object: |
| 25 // StorageBlock<TypeA> a(file, address); | 23 // StorageBlock<TypeA> a(file, address); |
| 26 // StorageBlock<TypeB> b(file, address); | 24 // StorageBlock<TypeB> b(file, address); |
| 27 // a.Load(); | 25 // a.Load(); |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 | 83 |
| 86 DISALLOW_COPY_AND_ASSIGN(StorageBlock); | 84 DISALLOW_COPY_AND_ASSIGN(StorageBlock); |
| 87 }; | 85 }; |
| 88 | 86 |
| 89 typedef StorageBlock<EntryStore> CacheEntryBlock; | 87 typedef StorageBlock<EntryStore> CacheEntryBlock; |
| 90 typedef StorageBlock<RankingsNode> CacheRankingsBlock; | 88 typedef StorageBlock<RankingsNode> CacheRankingsBlock; |
| 91 | 89 |
| 92 } // namespace disk_cache | 90 } // namespace disk_cache |
| 93 | 91 |
| 94 #endif // NET_DISK_CACHE_STORAGE_BLOCK_H__ | 92 #endif // NET_DISK_CACHE_STORAGE_BLOCK_H__ |
| OLD | NEW |