diff options
author | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-12 00:03:19 +0000 |
---|---|---|
committer | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-12 00:03:19 +0000 |
commit | 74a85ce422d6b52a79b3cf159203ec7fa35c15ee (patch) | |
tree | e35947baf74dd4325b926bf44a3364ed3cfe4038 /net/disk_cache/disk_cache.h | |
parent | 39008c0d7c9f627b6eeef41bd7ddb78b7ebe086d (diff) | |
download | chromium_src-74a85ce422d6b52a79b3cf159203ec7fa35c15ee.zip chromium_src-74a85ce422d6b52a79b3cf159203ec7fa35c15ee.tar.gz chromium_src-74a85ce422d6b52a79b3cf159203ec7fa35c15ee.tar.bz2 |
Extend the IOBuffer to the disk cache.
This is cleanup from bug 5325.
Original code review: http://codereview.chromium.org/20134/show
Review URL: http://codereview.chromium.org/20251
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9626 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/disk_cache/disk_cache.h')
-rw-r--r-- | net/disk_cache/disk_cache.h | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/net/disk_cache/disk_cache.h b/net/disk_cache/disk_cache.h index ab01086..59d2ad2 100644 --- a/net/disk_cache/disk_cache.h +++ b/net/disk_cache/disk_cache.h @@ -15,6 +15,10 @@ #include "base/time.h" #include "net/base/completion_callback.h" +namespace net { +class IOBuffer; +} + namespace disk_cache { class Entry; @@ -123,12 +127,13 @@ class Entry { // operation is complete. Otherwise, completion_callback will be // called on the current thread once the read completes. Returns the // number of bytes read or a network error code. If a completion callback is - // provided then it will be called if this function returns ERR_IO_PENDING. + // provided then it will be called if this function returns ERR_IO_PENDING, + // and a reference to |buf| will be retained until the callback is called. // Note that the callback will be invoked in any case, even after Close has // been called; in other words, the caller may close this entry without // having to wait for all the callbacks, and still rely on the cleanup // performed from the callback code. - virtual int ReadData(int index, int offset, char* buf, int buf_len, + virtual int ReadData(int index, int offset, net::IOBuffer* buf, int buf_len, net::CompletionCallback* completion_callback) = 0; // Copies cache data from the given buffer of length |buf_len|. If @@ -136,14 +141,15 @@ class Entry { // operation is complete. Otherwise, completion_callback will be // called on the current thread once the write completes. Returns the // number of bytes written or a network error code. If a completion callback - // is provided then it will be called if this function returns ERR_IO_PENDING. + // is provided then it will be called if this function returns ERR_IO_PENDING, + // and a reference to |buf| will be retained until the callback is called. // Note that the callback will be invoked in any case, even after Close has // been called; in other words, the caller may close this entry without // having to wait for all the callbacks, and still rely on the cleanup // performed from the callback code. // If truncate is true, this call will truncate the stored data at the end of // what we are writing here. - virtual int WriteData(int index, int offset, const char* buf, int buf_len, + virtual int WriteData(int index, int offset, net::IOBuffer* buf, int buf_len, net::CompletionCallback* completion_callback, bool truncate) = 0; |