summaryrefslogtreecommitdiffstats
path: root/net/disk_cache/entry_impl.h
diff options
context:
space:
mode:
authorrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-13 18:00:56 +0000
committerrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-13 18:00:56 +0000
commitfb2622f6816ed20ffd8a35994f7372b67613ba92 (patch)
tree2aa33016e72361032264904916c4374e4784fd11 /net/disk_cache/entry_impl.h
parentea9a4ee67732b90e834def1cf98be1d047a93063 (diff)
downloadchromium_src-fb2622f6816ed20ffd8a35994f7372b67613ba92.zip
chromium_src-fb2622f6816ed20ffd8a35994f7372b67613ba92.tar.gz
chromium_src-fb2622f6816ed20ffd8a35994f7372b67613ba92.tar.bz2
Disk cache: Switch the disk cache to use the cache_thread.
Add an InFlightBackendIO class that handles posting of cacheoperations back and forth between the IO thread and the cachethread. BUG=26730 TEST=unit tests Review URL: http://codereview.chromium.org/2945002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52185 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/disk_cache/entry_impl.h')
-rw-r--r--net/disk_cache/entry_impl.h17
1 files changed, 15 insertions, 2 deletions
diff --git a/net/disk_cache/entry_impl.h b/net/disk_cache/entry_impl.h
index 8ab4d44..1caece2 100644
--- a/net/disk_cache/entry_impl.h
+++ b/net/disk_cache/entry_impl.h
@@ -53,6 +53,20 @@ class EntryImpl : public Entry, public base::RefCounted<EntryImpl> {
virtual void CancelSparseIO();
virtual int ReadyForSparseIO(net::CompletionCallback* completion_callback);
+ // Background implementation of the Entry interface.
+ void DoomImpl();
+ int ReadDataImpl(int index, int offset, net::IOBuffer* buf, int buf_len,
+ CompletionCallback* callback);
+ int WriteDataImpl(int index, int offset, net::IOBuffer* buf, int buf_len,
+ CompletionCallback* callback, bool truncate);
+ int ReadSparseDataImpl(int64 offset, net::IOBuffer* buf, int buf_len,
+ CompletionCallback* callback);
+ int WriteSparseDataImpl(int64 offset, net::IOBuffer* buf, int buf_len,
+ CompletionCallback* callback);
+ int GetAvailableRangeImpl(int64 offset, int len, int64* start);
+ void CancelSparseIOImpl();
+ int ReadyForSparseIOImpl(CompletionCallback* callback);
+
inline CacheEntryBlock* entry() {
return &entry_;
}
@@ -186,8 +200,7 @@ class EntryImpl : public Entry, public base::RefCounted<EntryImpl> {
scoped_array<char> user_buffers_[kNumStreams]; // Store user data.
// Files to store external user data and key.
scoped_refptr<File> files_[kNumStreams + 1];
- // Copy of the file used to store the key. We don't own this object.
- mutable File* key_file_;
+ mutable std::string key_; // Copy of the key.
int unreported_size_[kNumStreams]; // Bytes not reported yet to the backend.
bool doomed_; // True if this entry was removed from the cache.
scoped_ptr<SparseControl> sparse_; // Support for sparse entries.