diff options
author | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-10 23:08:33 +0000 |
---|---|---|
committer | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-10 23:08:33 +0000 |
commit | 4d8a425272c3a2749c9a0d13cce43df3be8de789 (patch) | |
tree | cf903adb661feb8477e06ffe465101ef4eb6b91e /net/tools | |
parent | c07d895f10758a47d36ba70cbd9f032ad9e34477 (diff) | |
download | chromium_src-4d8a425272c3a2749c9a0d13cce43df3be8de789.zip chromium_src-4d8a425272c3a2749c9a0d13cce43df3be8de789.tar.gz chromium_src-4d8a425272c3a2749c9a0d13cce43df3be8de789.tar.bz2 |
Extend the IOBuffer to the disk cache.
This is cleanup from bug 5325.
Review URL: http://codereview.chromium.org/20134
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9528 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/tools')
-rw-r--r-- | net/tools/dump_cache/upgrade.cc | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/net/tools/dump_cache/upgrade.cc b/net/tools/dump_cache/upgrade.cc index d048c6f..6b4a2da 100644 --- a/net/tools/dump_cache/upgrade.cc +++ b/net/tools/dump_cache/upgrade.cc @@ -5,6 +5,7 @@ #include "base/logging.h" #include "base/message_loop.h" #include "base/string_util.h" +#include "net/base/io_buffer.h" #include "net/disk_cache/backend_impl.h" #include "net/disk_cache/entry_impl.h" @@ -444,8 +445,10 @@ void MasterSM::DoReadData(int bytes_read) { return SendReadData(); } - if (read_size != entry_->WriteData(stream_, offset_, input_->buffer, - read_size, NULL, false)) + scoped_refptr<net::WrappedIOBuffer> buf = + new net::WrappedIOBuffer(input_->buffer); + if (read_size != entry_->WriteData(stream_, offset_, buf, read_size, NULL, + false)) return Fail(); offset_ += read_size; @@ -713,8 +716,9 @@ void SlaveSM::DoReadData() { stream < 0 || stream > 1 || size > kBufferSize) { msg.result = RESULT_INVALID_PARAMETER; } else { - int ret = entry_->ReadData(stream, input_->msg.arg3, output_->buffer, size, - NULL); + scoped_refptr<net::WrappedIOBuffer> buf = + new net::WrappedIOBuffer(output_->buffer); + int ret = entry_->ReadData(stream, input_->msg.arg3, buf, size, NULL); msg.buffer_bytes = (ret < 0) ? 0 : ret; msg.result = RESULT_OK; |