| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 | 39 |
| 40 class WTF_EXPORT ArrayBuffer : public RefCounted<ArrayBuffer> { | 40 class WTF_EXPORT ArrayBuffer : public RefCounted<ArrayBuffer> { |
| 41 public: | 41 public: |
| 42 static inline PassRefPtr<ArrayBuffer> create(unsigned numElements, unsigned
elementByteSize); | 42 static inline PassRefPtr<ArrayBuffer> create(unsigned numElements, unsigned
elementByteSize); |
| 43 static inline PassRefPtr<ArrayBuffer> create(ArrayBuffer*); | 43 static inline PassRefPtr<ArrayBuffer> create(ArrayBuffer*); |
| 44 static inline PassRefPtr<ArrayBuffer> create(const void* source, unsigned by
teLength); | 44 static inline PassRefPtr<ArrayBuffer> create(const void* source, unsigned by
teLength); |
| 45 static inline PassRefPtr<ArrayBuffer> create(ArrayBufferContents&); | 45 static inline PassRefPtr<ArrayBuffer> create(ArrayBufferContents&); |
| 46 | 46 |
| 47 static inline PassRefPtr<ArrayBuffer> createOrNull(unsigned numElements, uns
igned elementByteSize); | 47 static inline PassRefPtr<ArrayBuffer> createOrNull(unsigned numElements, uns
igned elementByteSize); |
| 48 | 48 |
| 49 // Only for use by Uint8ClampedArray::createUninitialized, | 49 // Only for use by XMLHttpRequest::responseArrayBuffer and Internals::serial
izeObject |
| 50 // XMLHttpRequest::responseArrayBuffer and Internals::serializeObject | |
| 51 // (through DOMArrayBuffer::createUninitialized). | 50 // (through DOMArrayBuffer::createUninitialized). |
| 52 static inline PassRefPtr<ArrayBuffer> createUninitialized(unsigned numElemen
ts, unsigned elementByteSize); | 51 static inline PassRefPtr<ArrayBuffer> createUninitialized(unsigned numElemen
ts, unsigned elementByteSize); |
| 53 | 52 |
| 54 inline void* data(); | 53 inline void* data(); |
| 55 inline const void* data() const; | 54 inline const void* data() const; |
| 56 inline unsigned byteLength() const; | 55 inline unsigned byteLength() const; |
| 57 | 56 |
| 58 // Creates a new ArrayBuffer object with copy of bytes in this object | 57 // Creates a new ArrayBuffer object with copy of bytes in this object |
| 59 // ranging from |begin| upto but not including |end|. | 58 // ranging from |begin| upto but not including |end|. |
| 60 inline PassRefPtr<ArrayBuffer> slice(int begin, int end) const; | 59 inline PassRefPtr<ArrayBuffer> slice(int begin, int end) const; |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 if (index < 0) | 194 if (index < 0) |
| 196 index = currentLength + index; | 195 index = currentLength + index; |
| 197 return clampValue(index, 0, currentLength); | 196 return clampValue(index, 0, currentLength); |
| 198 } | 197 } |
| 199 | 198 |
| 200 } // namespace WTF | 199 } // namespace WTF |
| 201 | 200 |
| 202 using WTF::ArrayBuffer; | 201 using WTF::ArrayBuffer; |
| 203 | 202 |
| 204 #endif // ArrayBuffer_h | 203 #endif // ArrayBuffer_h |
| OLD | NEW |