OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "base/numerics/safe_math.h" | 8 #include "base/numerics/safe_math.h" |
9 | 9 |
10 namespace net { | 10 namespace net { |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 } | 160 } |
161 | 161 |
162 char* GrowableIOBuffer::StartOfBuffer() { | 162 char* GrowableIOBuffer::StartOfBuffer() { |
163 return real_data_.get(); | 163 return real_data_.get(); |
164 } | 164 } |
165 | 165 |
166 GrowableIOBuffer::~GrowableIOBuffer() { | 166 GrowableIOBuffer::~GrowableIOBuffer() { |
167 data_ = NULL; | 167 data_ = NULL; |
168 } | 168 } |
169 | 169 |
170 PickledIOBuffer::PickledIOBuffer() : IOBuffer() {} | 170 PickledIOBuffer::PickledIOBuffer() : IOBuffer() { |
| 171 } |
171 | 172 |
172 void PickledIOBuffer::Done() { | 173 void PickledIOBuffer::Done() { |
173 data_ = const_cast<char*>(static_cast<const char*>(pickle_.data())); | 174 data_ = const_cast<char*>(static_cast<const char*>(pickle_.data())); |
174 } | 175 } |
175 | 176 |
176 PickledIOBuffer::~PickledIOBuffer() { data_ = NULL; } | 177 PickledIOBuffer::~PickledIOBuffer() { |
| 178 data_ = NULL; |
| 179 } |
177 | 180 |
178 WrappedIOBuffer::WrappedIOBuffer(const char* data) | 181 WrappedIOBuffer::WrappedIOBuffer(const char* data) |
179 : IOBuffer(const_cast<char*>(data)) { | 182 : IOBuffer(const_cast<char*>(data)) { |
180 } | 183 } |
181 | 184 |
182 WrappedIOBuffer::~WrappedIOBuffer() { | 185 WrappedIOBuffer::~WrappedIOBuffer() { |
183 data_ = NULL; | 186 data_ = NULL; |
184 } | 187 } |
185 | 188 |
186 } // namespace net | 189 } // namespace net |
OLD | NEW |