| Index: net/disk_cache/storage_block.h
|
| ===================================================================
|
| --- net/disk_cache/storage_block.h (revision 199883)
|
| +++ net/disk_cache/storage_block.h (working copy)
|
| @@ -4,8 +4,8 @@
|
|
|
| // See net/disk_cache/disk_cache.h for the public interface.
|
|
|
| -#ifndef NET_DISK_CACHE_STORAGE_BLOCK_H__
|
| -#define NET_DISK_CACHE_STORAGE_BLOCK_H__
|
| +#ifndef NET_DISK_CACHE_STORAGE_BLOCK_H_
|
| +#define NET_DISK_CACHE_STORAGE_BLOCK_H_
|
|
|
| #include "net/disk_cache/addr.h"
|
| #include "net/disk_cache/mapped_file.h"
|
| @@ -30,6 +30,7 @@
|
| template<typename T>
|
| class StorageBlock : public FileBlock {
|
| public:
|
| + StorageBlock();
|
| StorageBlock(MappedFile* file, Addr address);
|
| virtual ~StorageBlock();
|
|
|
| @@ -60,12 +61,18 @@
|
| // Gets a pointer to the internal storage (allocates storage if needed).
|
| T* Data();
|
|
|
| + // Returns the internal storage, if any.
|
| + T* ReleaseData();
|
| +
|
| // Returns true if there is data associated with this object.
|
| bool HasData() const;
|
|
|
| // Returns true if the internal hash is correct.
|
| bool VerifyHash() const;
|
|
|
| + // Updates the internal hash value.
|
| + void UpdateHash();
|
| +
|
| // Returns true if this object owns the data buffer, false if it is shared.
|
| bool own_data() const;
|
|
|
| @@ -74,6 +81,8 @@
|
| // Loads and store the data.
|
| bool Load();
|
| bool Store();
|
| + bool Load(FileIOCallback* callback, bool* completed);
|
| + bool Store(FileIOCallback* callback, bool* completed);
|
|
|
| private:
|
| void AllocateData();
|
| @@ -90,9 +99,6 @@
|
| DISALLOW_COPY_AND_ASSIGN(StorageBlock);
|
| };
|
|
|
| -typedef StorageBlock<EntryStore> CacheEntryBlock;
|
| -typedef StorageBlock<RankingsNode> CacheRankingsBlock;
|
| -
|
| } // namespace disk_cache
|
|
|
| -#endif // NET_DISK_CACHE_STORAGE_BLOCK_H__
|
| +#endif // NET_DISK_CACHE_STORAGE_BLOCK_H_
|
|
|