| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 | 9 |
| 10 #include "net/disk_cache/addr.h" | 10 #include "net/disk_cache/addr.h" |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 bool HasData() const; | 56 bool HasData() const; |
| 57 | 57 |
| 58 const Addr address() const; | 58 const Addr address() const; |
| 59 | 59 |
| 60 // Loads and store the data. | 60 // Loads and store the data. |
| 61 bool Load(); | 61 bool Load(); |
| 62 bool Store(); | 62 bool Store(); |
| 63 | 63 |
| 64 private: | 64 private: |
| 65 void AllocateData(); | 65 void AllocateData(); |
| 66 void DeleteData(); |
| 66 | 67 |
| 67 T* data_; | 68 T* data_; |
| 68 MappedFile* file_; | 69 MappedFile* file_; |
| 69 Addr address_; | 70 Addr address_; |
| 70 bool modified_; | 71 bool modified_; |
| 71 bool own_data_; // Is data_ owned by this object or shared with someone else. | 72 bool own_data_; // Is data_ owned by this object or shared with someone else. |
| 72 bool extended_; // Used to store an entry of more than one block. | 73 bool extended_; // Used to store an entry of more than one block. |
| 73 | 74 |
| 74 DISALLOW_EVIL_CONSTRUCTORS(StorageBlock); | 75 DISALLOW_EVIL_CONSTRUCTORS(StorageBlock); |
| 75 }; | 76 }; |
| 76 | 77 |
| 77 typedef StorageBlock<EntryStore> CacheEntryBlock; | 78 typedef StorageBlock<EntryStore> CacheEntryBlock; |
| 78 typedef StorageBlock<RankingsNode> CacheRankingsBlock; | 79 typedef StorageBlock<RankingsNode> CacheRankingsBlock; |
| 79 | 80 |
| 80 } // namespace disk_cache | 81 } // namespace disk_cache |
| 81 | 82 |
| 82 #endif // NET_DISK_CACHE_STORAGE_BLOCK_H__ | 83 #endif // NET_DISK_CACHE_STORAGE_BLOCK_H__ |
| 83 | 84 |
| OLD | NEW |