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

Unified Diff: net/disk_cache/mem_entry_impl.cc

Issue 20134: Extend the IOBuffer to the disk cache. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 10 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
Index: net/disk_cache/mem_entry_impl.cc
===================================================================
--- net/disk_cache/mem_entry_impl.cc (revision 9323)
+++ net/disk_cache/mem_entry_impl.cc (working copy)
@@ -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 @@
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 @@
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 @@
if (!buf_len)
return 0;
- memcpy(&(data_[index])[offset], buf, buf_len);
+ memcpy(&(data_[index])[offset], buf->data(), buf_len);
return buf_len;
}

Powered by Google App Engine
This is Rietveld 408576698