summaryrefslogtreecommitdiffstats
path: root/net/disk_cache/mem_entry_impl.cc
diff options
context:
space:
mode:
authorrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-12 00:03:19 +0000
committerrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-12 00:03:19 +0000
commit74a85ce422d6b52a79b3cf159203ec7fa35c15ee (patch)
treee35947baf74dd4325b926bf44a3364ed3cfe4038 /net/disk_cache/mem_entry_impl.cc
parent39008c0d7c9f627b6eeef41bd7ddb78b7ebe086d (diff)
downloadchromium_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/mem_entry_impl.cc')
-rw-r--r--net/disk_cache/mem_entry_impl.cc14
1 files changed, 7 insertions, 7 deletions
diff --git a/net/disk_cache/mem_entry_impl.cc b/net/disk_cache/mem_entry_impl.cc
index 6bc7b6b..99c53cd 100644
--- a/net/disk_cache/mem_entry_impl.cc
+++ b/net/disk_cache/mem_entry_impl.cc
@@ -4,6 +4,7 @@
#include "net/disk_cache/mem_entry_impl.h"
+#include "net/base/io_buffer.h"
#include "net/base/net_errors.h"
#include "net/disk_cache/mem_backend_impl.h"
@@ -82,8 +83,8 @@ int32 MemEntryImpl::GetDataSize(int index) const {
return data_size_[index];
}
-int MemEntryImpl::ReadData(int index, int offset, char* buf, int buf_len,
- net::CompletionCallback* completion_callback) {
+int MemEntryImpl::ReadData(int index, int offset, net::IOBuffer* buf,
+ int buf_len, net::CompletionCallback* completion_callback) {
if (index < 0 || index >= NUM_STREAMS)
return net::ERR_INVALID_ARGUMENT;
@@ -99,13 +100,12 @@ int MemEntryImpl::ReadData(int index, int offset, char* buf, int buf_len,
UpdateRank(false);
- memcpy(buf , &(data_[index])[offset], buf_len);
+ memcpy(buf->data() , &(data_[index])[offset], buf_len);
return buf_len;
}
-int MemEntryImpl::WriteData(int index, int offset, const char* buf, int buf_len,
- net::CompletionCallback* completion_callback,
- bool truncate) {
+int MemEntryImpl::WriteData(int index, int offset, net::IOBuffer* buf,
+ int buf_len, net::CompletionCallback* completion_callback, bool truncate) {
if (index < 0 || index >= NUM_STREAMS)
return net::ERR_INVALID_ARGUMENT;
@@ -143,7 +143,7 @@ int MemEntryImpl::WriteData(int index, int offset, const char* buf, int buf_len,
if (!buf_len)
return 0;
- memcpy(&(data_[index])[offset], buf, buf_len);
+ memcpy(&(data_[index])[offset], buf->data(), buf_len);
return buf_len;
}