summaryrefslogtreecommitdiffstats
path: root/net/base/io_buffer.cc
diff options
context:
space:
mode:
Diffstat (limited to 'net/base/io_buffer.cc')
-rw-r--r--net/base/io_buffer.cc21
1 files changed, 10 insertions, 11 deletions
diff --git a/net/base/io_buffer.cc b/net/base/io_buffer.cc
index dfd4d38..7e5a1fe 100644
--- a/net/base/io_buffer.cc
+++ b/net/base/io_buffer.cc
@@ -52,11 +52,6 @@ DrainableIOBuffer::DrainableIOBuffer(IOBuffer* base, int size)
used_(0) {
}
-DrainableIOBuffer::~DrainableIOBuffer() {
- // The buffer is owned by the |base_| instance.
- data_ = NULL;
-}
-
void DrainableIOBuffer::DidConsume(int bytes) {
SetOffset(used_ + bytes);
}
@@ -76,16 +71,17 @@ void DrainableIOBuffer::SetOffset(int bytes) {
data_ = base_->data() + used_;
}
+DrainableIOBuffer::~DrainableIOBuffer() {
+ // The buffer is owned by the |base_| instance.
+ data_ = NULL;
+}
+
GrowableIOBuffer::GrowableIOBuffer()
: IOBuffer(),
capacity_(0),
offset_(0) {
}
-GrowableIOBuffer::~GrowableIOBuffer() {
- data_ = NULL;
-}
-
void GrowableIOBuffer::SetCapacity(int capacity) {
DCHECK(capacity >= 0);
// realloc will crash if it fails.
@@ -111,14 +107,17 @@ char* GrowableIOBuffer::StartOfBuffer() {
return real_data_.get();
}
-PickledIOBuffer::PickledIOBuffer() : IOBuffer() {}
+GrowableIOBuffer::~GrowableIOBuffer() {
+ data_ = NULL;
+}
-PickledIOBuffer::~PickledIOBuffer() { data_ = NULL; }
+PickledIOBuffer::PickledIOBuffer() : IOBuffer() {}
void PickledIOBuffer::Done() {
data_ = const_cast<char*>(static_cast<const char*>(pickle_.data()));
}
+PickledIOBuffer::~PickledIOBuffer() { data_ = NULL; }
WrappedIOBuffer::WrappedIOBuffer(const char* data)
: IOBuffer(const_cast<char*>(data)) {