| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "net/base/io_buffer.h" | 5 #include "net/base/io_buffer.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 | 8 |
| 9 namespace net { | 9 namespace net { |
| 10 | 10 |
| 11 IOBuffer::IOBuffer(int buffer_size) { | 11 IOBuffer::IOBuffer(int buffer_size) { |
| 12 DCHECK(buffer_size > 0); | 12 DCHECK(buffer_size > 0); |
| 13 data_ = new char[buffer_size]; | 13 data_ = new char[buffer_size]; |
| 14 } | 14 } |
| 15 void ReusedIOBuffer::SetOffset(int offset) { |
| 16 DCHECK(offset > 0 && offset < size_); |
| 17 data_ = base_->data() + offset; |
| 18 } |
| 15 | 19 |
| 16 } // namespace net | 20 } // namespace net |
| OLD | NEW |