| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2009 Google Inc. All rights reserved. | 3 * Copyright (C) 2009 Google Inc. 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 14 matching lines...) Expand all Loading... |
| 25 */ | 25 */ |
| 26 | 26 |
| 27 #ifndef Int32Array_h | 27 #ifndef Int32Array_h |
| 28 #define Int32Array_h | 28 #define Int32Array_h |
| 29 | 29 |
| 30 #include "wtf/IntegralTypedArrayBase.h" | 30 #include "wtf/IntegralTypedArrayBase.h" |
| 31 | 31 |
| 32 namespace WTF { | 32 namespace WTF { |
| 33 | 33 |
| 34 class Int32Array final : public IntegralTypedArrayBase<int> { | 34 class Int32Array final : public IntegralTypedArrayBase<int> { |
| 35 public: | 35 public: |
| 36 static inline PassRefPtr<Int32Array> create(unsigned length); | 36 static inline PassRefPtr<Int32Array> create(unsigned length); |
| 37 static inline PassRefPtr<Int32Array> create(const int* array, unsigned lengt
h); | 37 static inline PassRefPtr<Int32Array> create(const int* array, unsigned length)
; |
| 38 static inline PassRefPtr<Int32Array> create(PassRefPtr<ArrayBuffer>, unsigne
d byteOffset, unsigned length); | 38 static inline PassRefPtr<Int32Array> create(PassRefPtr<ArrayBuffer>, unsigned
byteOffset, unsigned length); |
| 39 | 39 |
| 40 using TypedArrayBase<int>::set; | 40 using TypedArrayBase<int>::set; |
| 41 using IntegralTypedArrayBase<int>::set; | 41 using IntegralTypedArrayBase<int>::set; |
| 42 | 42 |
| 43 ViewType type() const override | 43 ViewType type() const override { |
| 44 { | 44 return TypeInt32; |
| 45 return TypeInt32; | 45 } |
| 46 } | |
| 47 | 46 |
| 48 private: | 47 private: |
| 49 inline Int32Array(PassRefPtr<ArrayBuffer>, unsigned byteOffset, unsigned len
gth); | 48 inline Int32Array(PassRefPtr<ArrayBuffer>, unsigned byteOffset, unsigned lengt
h); |
| 50 // Make constructor visible to superclass. | 49 // Make constructor visible to superclass. |
| 51 friend class TypedArrayBase<int>; | 50 friend class TypedArrayBase<int>; |
| 52 }; | 51 }; |
| 53 | 52 |
| 54 PassRefPtr<Int32Array> Int32Array::create(unsigned length) | 53 PassRefPtr<Int32Array> Int32Array::create(unsigned length) { |
| 55 { | 54 return TypedArrayBase<int>::create<Int32Array>(length); |
| 56 return TypedArrayBase<int>::create<Int32Array>(length); | |
| 57 } | 55 } |
| 58 | 56 |
| 59 PassRefPtr<Int32Array> Int32Array::create(const int* array, unsigned length) | 57 PassRefPtr<Int32Array> Int32Array::create(const int* array, unsigned length) { |
| 60 { | 58 return TypedArrayBase<int>::create<Int32Array>(array, length); |
| 61 return TypedArrayBase<int>::create<Int32Array>(array, length); | |
| 62 } | 59 } |
| 63 | 60 |
| 64 PassRefPtr<Int32Array> Int32Array::create(PassRefPtr<ArrayBuffer> buffer, unsign
ed byteOffset, unsigned length) | 61 PassRefPtr<Int32Array> Int32Array::create(PassRefPtr<ArrayBuffer> buffer, unsign
ed byteOffset, unsigned length) { |
| 65 { | 62 return TypedArrayBase<int>::create<Int32Array>(buffer, byteOffset, length); |
| 66 return TypedArrayBase<int>::create<Int32Array>(buffer, byteOffset, length); | |
| 67 } | 63 } |
| 68 | 64 |
| 69 Int32Array::Int32Array(PassRefPtr<ArrayBuffer> buffer, unsigned byteOffset, unsi
gned length) | 65 Int32Array::Int32Array(PassRefPtr<ArrayBuffer> buffer, unsigned byteOffset, unsi
gned length) |
| 70 : IntegralTypedArrayBase<int>(buffer, byteOffset, length) | 66 : IntegralTypedArrayBase<int>(buffer, byteOffset, length) { |
| 71 { | |
| 72 } | 67 } |
| 73 | 68 |
| 74 } // namespace WTF | 69 } // namespace WTF |
| 75 | 70 |
| 76 using WTF::Int32Array; | 71 using WTF::Int32Array; |
| 77 | 72 |
| 78 #endif // Int32Array_h | 73 #endif // Int32Array_h |
| OLD | NEW |