Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(298)

Unified Diff: net/disk_cache/storage_block.h

Issue 15203004: Disk cache: Reference CL for the implementation of file format version 3. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/disk_cache/rankings.cc ('k') | net/disk_cache/storage_block_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_
« no previous file with comments | « net/disk_cache/rankings.cc ('k') | net/disk_cache/storage_block_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698