| 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 return view()->setRange(data, dataLength, offset); | 61 return view()->setRange(data, dataLength, offset); |
| 62 } | 62 } |
| 63 bool zeroRange(unsigned offset, size_t length) | 63 bool zeroRange(unsigned offset, size_t length) |
| 64 { | 64 { |
| 65 return view()->zeroRange(offset, length); | 65 return view()->zeroRange(offset, length); |
| 66 } | 66 } |
| 67 // Invoked by the indexed getter. Does not perform range checks; caller | 67 // Invoked by the indexed getter. Does not perform range checks; caller |
| 68 // is responsible for doing so and returning undefined as necessary. | 68 // is responsible for doing so and returning undefined as necessary. |
| 69 ValueType item(unsigned index) const { return view()->item(index); } | 69 ValueType item(unsigned index) const { return view()->item(index); } |
| 70 | 70 |
| 71 virtual v8::Local<v8::Object> wrap(v8::Local<v8::Object> creationContext, v8
::Isolate*) override; | 71 virtual v8::Local<v8::Object> wrap(v8::Isolate*, v8::Local<v8::Object> creat
ionContext) override; |
| 72 virtual v8::Local<v8::Object> associateWithWrapper(v8::Isolate*, const Wrapp
erTypeInfo*, v8::Local<v8::Object> wrapper) override; | 72 virtual v8::Local<v8::Object> associateWithWrapper(v8::Isolate*, const Wrapp
erTypeInfo*, v8::Local<v8::Object> wrapper) override; |
| 73 | 73 |
| 74 private: | 74 private: |
| 75 explicit DOMTypedArray(PassRefPtr<WTFTypedArray> bufferView) | 75 explicit DOMTypedArray(PassRefPtr<WTFTypedArray> bufferView) |
| 76 : DOMArrayBufferView(bufferView) { } | 76 : DOMArrayBufferView(bufferView) { } |
| 77 DOMTypedArray(PassRefPtr<WTFTypedArray> bufferView, PassRefPtr<DOMArrayBuffe
r> domArrayBuffer) | 77 DOMTypedArray(PassRefPtr<WTFTypedArray> bufferView, PassRefPtr<DOMArrayBuffe
r> domArrayBuffer) |
| 78 : DOMArrayBufferView(bufferView, domArrayBuffer) { } | 78 : DOMArrayBufferView(bufferView, domArrayBuffer) { } |
| 79 }; | 79 }; |
| 80 | 80 |
| 81 extern template class CORE_TEMPLATE_EXPORT DOMTypedArray<WTF::Int8Array, v8::Int
8Array>; | 81 extern template class CORE_TEMPLATE_EXPORT DOMTypedArray<WTF::Int8Array, v8::Int
8Array>; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 94 typedef DOMTypedArray<WTF::Uint8Array, v8::Uint8Array> DOMUint8Array; | 94 typedef DOMTypedArray<WTF::Uint8Array, v8::Uint8Array> DOMUint8Array; |
| 95 typedef DOMTypedArray<WTF::Uint8ClampedArray, v8::Uint8ClampedArray> DOMUint8Cla
mpedArray; | 95 typedef DOMTypedArray<WTF::Uint8ClampedArray, v8::Uint8ClampedArray> DOMUint8Cla
mpedArray; |
| 96 typedef DOMTypedArray<WTF::Uint16Array, v8::Uint16Array> DOMUint16Array; | 96 typedef DOMTypedArray<WTF::Uint16Array, v8::Uint16Array> DOMUint16Array; |
| 97 typedef DOMTypedArray<WTF::Uint32Array, v8::Uint32Array> DOMUint32Array; | 97 typedef DOMTypedArray<WTF::Uint32Array, v8::Uint32Array> DOMUint32Array; |
| 98 typedef DOMTypedArray<WTF::Float32Array, v8::Float32Array> DOMFloat32Array; | 98 typedef DOMTypedArray<WTF::Float32Array, v8::Float32Array> DOMFloat32Array; |
| 99 typedef DOMTypedArray<WTF::Float64Array, v8::Float64Array> DOMFloat64Array; | 99 typedef DOMTypedArray<WTF::Float64Array, v8::Float64Array> DOMFloat64Array; |
| 100 | 100 |
| 101 } // namespace blink | 101 } // namespace blink |
| 102 | 102 |
| 103 #endif // DOMTypedArray_h | 103 #endif // DOMTypedArray_h |
| OLD | NEW |