| 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, |
| 38 static inline PassRefPtr<Int32Array> create(PassRefPtr<ArrayBuffer>, unsigne
d byteOffset, unsigned length); | 38 unsigned length); |
| 39 static inline PassRefPtr<Int32Array> create(PassRefPtr<ArrayBuffer>, |
| 40 unsigned byteOffset, |
| 41 unsigned length); |
| 39 | 42 |
| 40 using TypedArrayBase<int>::set; | 43 using TypedArrayBase<int>::set; |
| 41 using IntegralTypedArrayBase<int>::set; | 44 using IntegralTypedArrayBase<int>::set; |
| 42 | 45 |
| 43 ViewType type() const override | 46 ViewType type() const override { return TypeInt32; } |
| 44 { | |
| 45 return TypeInt32; | |
| 46 } | |
| 47 | 47 |
| 48 private: | 48 private: |
| 49 inline Int32Array(PassRefPtr<ArrayBuffer>, unsigned byteOffset, unsigned len
gth); | 49 inline Int32Array(PassRefPtr<ArrayBuffer>, |
| 50 // Make constructor visible to superclass. | 50 unsigned byteOffset, |
| 51 friend class TypedArrayBase<int>; | 51 unsigned length); |
| 52 // Make constructor visible to superclass. |
| 53 friend class TypedArrayBase<int>; |
| 52 }; | 54 }; |
| 53 | 55 |
| 54 PassRefPtr<Int32Array> Int32Array::create(unsigned length) | 56 PassRefPtr<Int32Array> Int32Array::create(unsigned length) { |
| 55 { | 57 return TypedArrayBase<int>::create<Int32Array>(length); |
| 56 return TypedArrayBase<int>::create<Int32Array>(length); | |
| 57 } | 58 } |
| 58 | 59 |
| 59 PassRefPtr<Int32Array> Int32Array::create(const int* array, unsigned length) | 60 PassRefPtr<Int32Array> Int32Array::create(const int* array, unsigned length) { |
| 60 { | 61 return TypedArrayBase<int>::create<Int32Array>(array, length); |
| 61 return TypedArrayBase<int>::create<Int32Array>(array, length); | |
| 62 } | 62 } |
| 63 | 63 |
| 64 PassRefPtr<Int32Array> Int32Array::create(PassRefPtr<ArrayBuffer> buffer, unsign
ed byteOffset, unsigned length) | 64 PassRefPtr<Int32Array> Int32Array::create(PassRefPtr<ArrayBuffer> buffer, |
| 65 { | 65 unsigned byteOffset, |
| 66 return TypedArrayBase<int>::create<Int32Array>(buffer, byteOffset, length); | 66 unsigned length) { |
| 67 return TypedArrayBase<int>::create<Int32Array>(buffer, byteOffset, length); |
| 67 } | 68 } |
| 68 | 69 |
| 69 Int32Array::Int32Array(PassRefPtr<ArrayBuffer> buffer, unsigned byteOffset, unsi
gned length) | 70 Int32Array::Int32Array(PassRefPtr<ArrayBuffer> buffer, |
| 70 : IntegralTypedArrayBase<int>(buffer, byteOffset, length) | 71 unsigned byteOffset, |
| 71 { | 72 unsigned length) |
| 72 } | 73 : IntegralTypedArrayBase<int>(buffer, byteOffset, length) {} |
| 73 | 74 |
| 74 } // namespace WTF | 75 } // namespace WTF |
| 75 | 76 |
| 76 using WTF::Int32Array; | 77 using WTF::Int32Array; |
| 77 | 78 |
| 78 #endif // Int32Array_h | 79 #endif // Int32Array_h |
| OLD | NEW |