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

Unified Diff: net/base/io_buffer.cc

Issue 178473022: MTP Streaming: Readahead Buffer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: this patchset allows memory reuse Created 6 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
« net/base/io_buffer.h ('K') | « net/base/io_buffer.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/io_buffer.cc
diff --git a/net/base/io_buffer.cc b/net/base/io_buffer.cc
index dd1d4517eeab06721b62d3f70faf7c91f3a885d1..a233e3f1f712107d4651423edb1a5402f255a9d8 100644
--- a/net/base/io_buffer.cc
+++ b/net/base/io_buffer.cc
@@ -79,6 +79,12 @@ void DrainableIOBuffer::SetOffset(int bytes) {
data_ = base_->data() + used_;
}
+void DrainableIOBuffer::SetSize(int size) {
+ DCHECK_GE(size, 0);
+ DCHECK_LE(used_, size);
+ size_ = size;
+}
+
DrainableIOBuffer::~DrainableIOBuffer() {
// The buffer is owned by the |base_| instance.
data_ = NULL;
« net/base/io_buffer.h ('K') | « net/base/io_buffer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698