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/dom/DOMArrayBufferView.h" | 9 #include "core/dom/DOMArrayBufferView.h" |
10 #include "wtf/Float32Array.h" | 10 #include "wtf/Float32Array.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 return adoptRef(new ThisType(bufferView.release(), buffer)); | 56 return adoptRef(new ThisType(bufferView.release(), buffer)); |
57 } | 57 } |
58 | 58 |
59 const WTFTypedArray* view() const { return static_cast<const WTFTypedArray*>
(DOMArrayBufferView::view()); } | 59 const WTFTypedArray* view() const { return static_cast<const WTFTypedArray*>
(DOMArrayBufferView::view()); } |
60 WTFTypedArray* view() { return static_cast<WTFTypedArray*>(DOMArrayBufferVie
w::view()); } | 60 WTFTypedArray* view() { return static_cast<WTFTypedArray*>(DOMArrayBufferVie
w::view()); } |
61 | 61 |
62 ValueType* data() const { return view()->data(); } | 62 ValueType* data() const { return view()->data(); } |
63 unsigned length() const { return view()->length(); } | 63 unsigned length() const { return view()->length(); } |
64 | 64 |
65 virtual v8::Handle<v8::Object> wrap(v8::Handle<v8::Object> creationContext,
v8::Isolate*) override; | 65 virtual v8::Handle<v8::Object> wrap(v8::Handle<v8::Object> creationContext,
v8::Isolate*) override; |
66 virtual v8::Handle<v8::Object> associateWithWrapper(const WrapperTypeInfo*,
v8::Handle<v8::Object> wrapper, v8::Isolate*) override; | 66 virtual v8::Handle<v8::Object> associateWithWrapper(v8::Isolate*, const Wrap
perTypeInfo*, v8::Handle<v8::Object> wrapper) override; |
67 | 67 |
68 private: | 68 private: |
69 explicit DOMTypedArray(PassRefPtr<WTFTypedArray> bufferView) | 69 explicit DOMTypedArray(PassRefPtr<WTFTypedArray> bufferView) |
70 : DOMArrayBufferView(bufferView) { } | 70 : DOMArrayBufferView(bufferView) { } |
71 DOMTypedArray(PassRefPtr<WTFTypedArray> bufferView, PassRefPtr<DOMArrayBuffe
r> domArrayBuffer) | 71 DOMTypedArray(PassRefPtr<WTFTypedArray> bufferView, PassRefPtr<DOMArrayBuffe
r> domArrayBuffer) |
72 : DOMArrayBufferView(bufferView, domArrayBuffer) { } | 72 : DOMArrayBufferView(bufferView, domArrayBuffer) { } |
73 }; | 73 }; |
74 | 74 |
75 typedef DOMTypedArray<WTF::Int8Array, v8::Int8Array> DOMInt8Array; | 75 typedef DOMTypedArray<WTF::Int8Array, v8::Int8Array> DOMInt8Array; |
76 typedef DOMTypedArray<WTF::Int16Array, v8::Int16Array> DOMInt16Array; | 76 typedef DOMTypedArray<WTF::Int16Array, v8::Int16Array> DOMInt16Array; |
77 typedef DOMTypedArray<WTF::Int32Array, v8::Int32Array> DOMInt32Array; | 77 typedef DOMTypedArray<WTF::Int32Array, v8::Int32Array> DOMInt32Array; |
78 typedef DOMTypedArray<WTF::Uint8Array, v8::Uint8Array> DOMUint8Array; | 78 typedef DOMTypedArray<WTF::Uint8Array, v8::Uint8Array> DOMUint8Array; |
79 typedef DOMTypedArray<WTF::Uint8ClampedArray, v8::Uint8ClampedArray> DOMUint8Cla
mpedArray; | 79 typedef DOMTypedArray<WTF::Uint8ClampedArray, v8::Uint8ClampedArray> DOMUint8Cla
mpedArray; |
80 typedef DOMTypedArray<WTF::Uint16Array, v8::Uint16Array> DOMUint16Array; | 80 typedef DOMTypedArray<WTF::Uint16Array, v8::Uint16Array> DOMUint16Array; |
81 typedef DOMTypedArray<WTF::Uint32Array, v8::Uint32Array> DOMUint32Array; | 81 typedef DOMTypedArray<WTF::Uint32Array, v8::Uint32Array> DOMUint32Array; |
82 typedef DOMTypedArray<WTF::Float32Array, v8::Float32Array> DOMFloat32Array; | 82 typedef DOMTypedArray<WTF::Float32Array, v8::Float32Array> DOMFloat32Array; |
83 typedef DOMTypedArray<WTF::Float64Array, v8::Float64Array> DOMFloat64Array; | 83 typedef DOMTypedArray<WTF::Float64Array, v8::Float64Array> DOMFloat64Array; |
84 | 84 |
85 } // namespace blink | 85 } // namespace blink |
86 | 86 |
87 #endif // DOMTypedArray_h | 87 #endif // DOMTypedArray_h |
OLD | NEW |