OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved. |
3 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. | 3 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 { | 225 { |
226 return m_size; | 226 return m_size; |
227 } | 227 } |
228 | 228 |
229 const char* SharedBuffer::data() const | 229 const char* SharedBuffer::data() const |
230 { | 230 { |
231 mergeSegmentsIntoBuffer(); | 231 mergeSegmentsIntoBuffer(); |
232 return m_buffer.data(); | 232 return m_buffer.data(); |
233 } | 233 } |
234 | 234 |
235 void SharedBuffer::append(SharedBuffer* data) | 235 void SharedBuffer::append(PassRefPtr<SharedBuffer> data) |
236 { | 236 { |
237 const char* segment; | 237 const char* segment; |
238 size_t position = 0; | 238 size_t position = 0; |
239 while (size_t length = data->getSomeData(segment, position)) { | 239 while (size_t length = data->getSomeData(segment, position)) { |
240 append(segment, length); | 240 append(segment, length); |
241 position += length; | 241 position += length; |
242 } | 242 } |
243 } | 243 } |
244 | 244 |
245 void SharedBuffer::append(const char* data, unsigned length) | 245 void SharedBuffer::append(const char* data, unsigned length) |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 mergeSegmentsIntoBuffer(); | 414 mergeSegmentsIntoBuffer(); |
415 m_buffer.unlock(); | 415 m_buffer.unlock(); |
416 } | 416 } |
417 | 417 |
418 bool SharedBuffer::isLocked() const | 418 bool SharedBuffer::isLocked() const |
419 { | 419 { |
420 return m_buffer.isLocked(); | 420 return m_buffer.isLocked(); |
421 } | 421 } |
422 | 422 |
423 } // namespace WebCore | 423 } // namespace WebCore |
OLD | NEW |