| 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 14 matching lines...) Expand all Loading... |
| 25 | 25 |
| 26 #ifndef ArrayBuffer_h | 26 #ifndef ArrayBuffer_h |
| 27 #define ArrayBuffer_h | 27 #define ArrayBuffer_h |
| 28 | 28 |
| 29 #include "wtf/ArrayBufferContents.h" | 29 #include "wtf/ArrayBufferContents.h" |
| 30 #include "wtf/ArrayBufferDeallocationObserver.h" | 30 #include "wtf/ArrayBufferDeallocationObserver.h" |
| 31 #include "wtf/HashSet.h" | 31 #include "wtf/HashSet.h" |
| 32 #include "wtf/PassRefPtr.h" | 32 #include "wtf/PassRefPtr.h" |
| 33 #include "wtf/RefCounted.h" | 33 #include "wtf/RefCounted.h" |
| 34 #include "wtf/Vector.h" | 34 #include "wtf/Vector.h" |
| 35 #include "wtf/WTFExport.h" |
| 35 | 36 |
| 36 namespace WTF { | 37 namespace WTF { |
| 37 | 38 |
| 38 class ArrayBuffer; | 39 class ArrayBuffer; |
| 39 class ArrayBufferView; | 40 class ArrayBufferView; |
| 40 | 41 |
| 41 class ArrayBuffer : public RefCounted<ArrayBuffer> { | 42 class WTF_EXPORT ArrayBuffer : public RefCounted<ArrayBuffer> { |
| 42 public: | 43 public: |
| 43 static inline PassRefPtr<ArrayBuffer> create(unsigned numElements, unsigned
elementByteSize); | 44 static inline PassRefPtr<ArrayBuffer> create(unsigned numElements, unsigned
elementByteSize); |
| 44 static inline PassRefPtr<ArrayBuffer> create(ArrayBuffer*); | 45 static inline PassRefPtr<ArrayBuffer> create(ArrayBuffer*); |
| 45 static inline PassRefPtr<ArrayBuffer> create(const void* source, unsigned by
teLength); | 46 static inline PassRefPtr<ArrayBuffer> create(const void* source, unsigned by
teLength); |
| 46 static inline PassRefPtr<ArrayBuffer> create(ArrayBufferContents&); | 47 static inline PassRefPtr<ArrayBuffer> create(ArrayBufferContents&); |
| 47 | 48 |
| 48 // Only for use by Uint8ClampedArray::createUninitialized. | 49 // Only for use by Uint8ClampedArray::createUninitialized. |
| 49 static inline PassRefPtr<ArrayBuffer> createUninitialized(unsigned numElemen
ts, unsigned elementByteSize); | 50 static inline PassRefPtr<ArrayBuffer> createUninitialized(unsigned numElemen
ts, unsigned elementByteSize); |
| 50 | 51 |
| 51 inline void* data(); | 52 inline void* data(); |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 if (index < 0) | 170 if (index < 0) |
| 170 index = currentLength + index; | 171 index = currentLength + index; |
| 171 return clampValue(index, 0, currentLength); | 172 return clampValue(index, 0, currentLength); |
| 172 } | 173 } |
| 173 | 174 |
| 174 } // namespace WTF | 175 } // namespace WTF |
| 175 | 176 |
| 176 using WTF::ArrayBuffer; | 177 using WTF::ArrayBuffer; |
| 177 | 178 |
| 178 #endif // ArrayBuffer_h | 179 #endif // ArrayBuffer_h |
| OLD | NEW |