summaryrefslogtreecommitdiffstats
path: root/net/base/io_buffer.cc
blob: db2bffbc75f853aa84930c4eb23fa7dbf365a8c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "net/base/io_buffer.h"

#include "base/logging.h"

namespace net {

IOBuffer::IOBuffer(int buffer_size) {
  DCHECK(buffer_size > 0);
  data_ = new char[buffer_size];
}
void ReusedIOBuffer::SetOffset(int offset) {
  DCHECK(offset > 0 && offset < size_);
  data_ = base_->data() + offset;
}

}  // namespace net