diff options
| author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-07-30 11:37:48 +0200 |
|---|---|---|
| committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-07-30 11:38:52 +0200 |
| commit | 89e2486a48b739f8d771d69ede5a6a1b244a10fc (patch) | |
| tree | 503b1a7812cf97d93704c32437eb5f62dc1a1ff9 /Source/WTF/wtf/Uint32Array.h | |
| parent | 625f028249cb37c55bbbd153f3902afd0b0756d9 (diff) | |
| download | qtwebkit-89e2486a48b739f8d771d69ede5a6a1b244a10fc.tar.gz | |
Imported WebKit commit 0282df8ca7c11d8c8a66ea18543695c69f545a27 (http://svn.webkit.org/repository/webkit/trunk@124002)
New snapshot with prospective Mountain Lion build fix
Diffstat (limited to 'Source/WTF/wtf/Uint32Array.h')
| -rw-r--r-- | Source/WTF/wtf/Uint32Array.h | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/Source/WTF/wtf/Uint32Array.h b/Source/WTF/wtf/Uint32Array.h index a9cf6b152..1e5b02823 100644 --- a/Source/WTF/wtf/Uint32Array.h +++ b/Source/WTF/wtf/Uint32Array.h @@ -39,6 +39,10 @@ public: static inline PassRefPtr<Uint32Array> create(const unsigned int* array, unsigned length); static inline PassRefPtr<Uint32Array> create(PassRefPtr<ArrayBuffer>, unsigned byteOffset, unsigned length); + // Should only be used when it is known the entire array will be filled. Do + // not return these results directly to JavaScript without filling first. + static inline PassRefPtr<Uint32Array> createUninitialized(unsigned length); + // Can’t use "using" here due to a bug in the RVCT compiler. bool set(TypedArrayBase<unsigned int>* array, unsigned offset) { return TypedArrayBase<unsigned int>::set(array, offset); } void set(unsigned index, double value) { IntegralTypedArrayBase<unsigned int>::set(index, value); } @@ -46,15 +50,17 @@ public: inline PassRefPtr<Uint32Array> subarray(int start) const; inline PassRefPtr<Uint32Array> subarray(int start, int end) const; + virtual ViewType getType() const + { + return TypeUint32; + } + private: inline Uint32Array(PassRefPtr<ArrayBuffer>, unsigned byteOffset, unsigned length); // Make constructor visible to superclass. friend class TypedArrayBase<unsigned int>; - - // Overridden from ArrayBufferView. - virtual bool isUnsignedIntArray() const { return true; } }; PassRefPtr<Uint32Array> Uint32Array::create(unsigned length) @@ -72,6 +78,11 @@ PassRefPtr<Uint32Array> Uint32Array::create(PassRefPtr<ArrayBuffer> buffer, unsi return TypedArrayBase<unsigned int>::create<Uint32Array>(buffer, byteOffset, length); } +PassRefPtr<Uint32Array> Uint32Array::createUninitialized(unsigned length) +{ + return TypedArrayBase<unsigned int>::createUninitialized<Uint32Array>(length); +} + Uint32Array::Uint32Array(PassRefPtr<ArrayBuffer> buffer, unsigned byteOffset, unsigned length) : IntegralTypedArrayBase<unsigned int>(buffer, byteOffset, length) { |
