OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef DOMTypedArray_h | 5 #ifndef DOMTypedArray_h |
6 #define DOMTypedArray_h | 6 #define DOMTypedArray_h |
7 | 7 |
8 #include "bindings/core/v8/ScriptWrappable.h" | 8 #include "bindings/core/v8/ScriptWrappable.h" |
9 #include "core/CoreExport.h" | 9 #include "core/CoreExport.h" |
10 #include "core/dom/DOMArrayBufferView.h" | 10 #include "core/dom/DOMArrayBufferView.h" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 | 54 |
55 const WTFTypedArray* view() const { return static_cast<const WTFTypedArray*>
(DOMArrayBufferView::view()); } | 55 const WTFTypedArray* view() const { return static_cast<const WTFTypedArray*>
(DOMArrayBufferView::view()); } |
56 WTFTypedArray* view() { return static_cast<WTFTypedArray*>(DOMArrayBufferVie
w::view()); } | 56 WTFTypedArray* view() { return static_cast<WTFTypedArray*>(DOMArrayBufferVie
w::view()); } |
57 | 57 |
58 ValueType* data() const { return view()->data(); } | 58 ValueType* data() const { return view()->data(); } |
59 unsigned length() const { return view()->length(); } | 59 unsigned length() const { return view()->length(); } |
60 // Invoked by the indexed getter. Does not perform range checks; caller | 60 // Invoked by the indexed getter. Does not perform range checks; caller |
61 // is responsible for doing so and returning undefined as necessary. | 61 // is responsible for doing so and returning undefined as necessary. |
62 ValueType item(unsigned index) const { return view()->item(index); } | 62 ValueType item(unsigned index) const { return view()->item(index); } |
63 | 63 |
64 virtual v8::Local<v8::Object> wrap(v8::Isolate*, v8::Local<v8::Object> creat
ionContext) override; | 64 v8::Local<v8::Object> wrap(v8::Isolate*, v8::Local<v8::Object> creationConte
xt) override; |
65 virtual v8::Local<v8::Object> associateWithWrapper(v8::Isolate*, const Wrapp
erTypeInfo*, v8::Local<v8::Object> wrapper) override; | 65 v8::Local<v8::Object> associateWithWrapper(v8::Isolate*, const WrapperTypeIn
fo*, v8::Local<v8::Object> wrapper) override; |
66 | 66 |
67 private: | 67 private: |
68 explicit DOMTypedArray(PassRefPtr<WTFTypedArray> bufferView) | 68 explicit DOMTypedArray(PassRefPtr<WTFTypedArray> bufferView) |
69 : DOMArrayBufferView(bufferView) { } | 69 : DOMArrayBufferView(bufferView) { } |
70 DOMTypedArray(PassRefPtr<WTFTypedArray> bufferView, PassRefPtr<DOMArrayBuffe
rBase> domArrayBuffer) | 70 DOMTypedArray(PassRefPtr<WTFTypedArray> bufferView, PassRefPtr<DOMArrayBuffe
rBase> domArrayBuffer) |
71 : DOMArrayBufferView(bufferView, domArrayBuffer) { } | 71 : DOMArrayBufferView(bufferView, domArrayBuffer) { } |
72 }; | 72 }; |
73 | 73 |
74 extern template class CORE_EXTERN_TEMPLATE_EXPORT DOMTypedArray<WTF::Int8Array,
v8::Int8Array>; | 74 extern template class CORE_EXTERN_TEMPLATE_EXPORT DOMTypedArray<WTF::Int8Array,
v8::Int8Array>; |
75 extern template class CORE_EXTERN_TEMPLATE_EXPORT DOMTypedArray<WTF::Int16Array,
v8::Int16Array>; | 75 extern template class CORE_EXTERN_TEMPLATE_EXPORT DOMTypedArray<WTF::Int16Array,
v8::Int16Array>; |
(...skipping 11 matching lines...) Expand all Loading... |
87 typedef DOMTypedArray<WTF::Uint8Array, v8::Uint8Array> DOMUint8Array; | 87 typedef DOMTypedArray<WTF::Uint8Array, v8::Uint8Array> DOMUint8Array; |
88 typedef DOMTypedArray<WTF::Uint8ClampedArray, v8::Uint8ClampedArray> DOMUint8Cla
mpedArray; | 88 typedef DOMTypedArray<WTF::Uint8ClampedArray, v8::Uint8ClampedArray> DOMUint8Cla
mpedArray; |
89 typedef DOMTypedArray<WTF::Uint16Array, v8::Uint16Array> DOMUint16Array; | 89 typedef DOMTypedArray<WTF::Uint16Array, v8::Uint16Array> DOMUint16Array; |
90 typedef DOMTypedArray<WTF::Uint32Array, v8::Uint32Array> DOMUint32Array; | 90 typedef DOMTypedArray<WTF::Uint32Array, v8::Uint32Array> DOMUint32Array; |
91 typedef DOMTypedArray<WTF::Float32Array, v8::Float32Array> DOMFloat32Array; | 91 typedef DOMTypedArray<WTF::Float32Array, v8::Float32Array> DOMFloat32Array; |
92 typedef DOMTypedArray<WTF::Float64Array, v8::Float64Array> DOMFloat64Array; | 92 typedef DOMTypedArray<WTF::Float64Array, v8::Float64Array> DOMFloat64Array; |
93 | 93 |
94 } // namespace blink | 94 } // namespace blink |
95 | 95 |
96 #endif // DOMTypedArray_h | 96 #endif // DOMTypedArray_h |
OLD | NEW |