| 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 #include "config.h" | 5 #include "config.h" |
| 6 #include "core/dom/DOMTypedArray.h" | 6 #include "core/dom/DOMTypedArray.h" |
| 7 | 7 |
| 8 #include "bindings/core/v8/DOMDataStore.h" | 8 #include "bindings/core/v8/DOMDataStore.h" |
| 9 #include "bindings/core/v8/V8ArrayBuffer.h" | 9 #include "bindings/core/v8/V8ArrayBuffer.h" |
| 10 #include "bindings/core/v8/V8DOMWrapper.h" | 10 #include "bindings/core/v8/V8DOMWrapper.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 ASSERT(v8Buffer->IsArrayBuffer()); | 27 ASSERT(v8Buffer->IsArrayBuffer()); |
| 28 | 28 |
| 29 v8::Handle<v8::Object> wrapper = V8TypedArray::New(v8Buffer.As<v8::ArrayBuff
er>(), byteOffset(), length()); | 29 v8::Handle<v8::Object> wrapper = V8TypedArray::New(v8Buffer.As<v8::ArrayBuff
er>(), byteOffset(), length()); |
| 30 | 30 |
| 31 return associateWithWrapper(wrapperTypeInfo, wrapper, isolate); | 31 return associateWithWrapper(wrapperTypeInfo, wrapper, isolate); |
| 32 } | 32 } |
| 33 | 33 |
| 34 template<typename WTFTypedArray, typename V8TypedArray> | 34 template<typename WTFTypedArray, typename V8TypedArray> |
| 35 v8::Handle<v8::Object> DOMTypedArray<WTFTypedArray, V8TypedArray>::associateWith
Wrapper(const WrapperTypeInfo* wrapperTypeInfo, v8::Handle<v8::Object> wrapper,
v8::Isolate* isolate) | 35 v8::Handle<v8::Object> DOMTypedArray<WTFTypedArray, V8TypedArray>::associateWith
Wrapper(const WrapperTypeInfo* wrapperTypeInfo, v8::Handle<v8::Object> wrapper,
v8::Isolate* isolate) |
| 36 { | 36 { |
| 37 return V8DOMWrapper::associateObjectWithWrapperNonTemplate(this, wrapperType
Info, wrapper, isolate); | 37 return V8DOMWrapper::associateObjectWithWrapperNonTemplate(isolate, this, wr
apperTypeInfo, wrapper); |
| 38 } | 38 } |
| 39 | 39 |
| 40 // Instantiation of the non-inline functions of the template classes. | 40 // Instantiation of the non-inline functions of the template classes. |
| 41 #define INSTANTIATE_DOMTYPEDARRAY_MEMBER_FUNCTIONS(Type) \ | 41 #define INSTANTIATE_DOMTYPEDARRAY_MEMBER_FUNCTIONS(Type) \ |
| 42 INSTANTIATE_DOMTYPEDARRAY_MEMBER_FUNCTIONS_IMPL(WTF::Type##Array, v8::Type##
Array) | 42 INSTANTIATE_DOMTYPEDARRAY_MEMBER_FUNCTIONS_IMPL(WTF::Type##Array, v8::Type##
Array) |
| 43 #define INSTANTIATE_DOMTYPEDARRAY_MEMBER_FUNCTIONS_IMPL(WTFTypedArray, V8TypedAr
ray) \ | 43 #define INSTANTIATE_DOMTYPEDARRAY_MEMBER_FUNCTIONS_IMPL(WTFTypedArray, V8TypedAr
ray) \ |
| 44 template v8::Handle<v8::Object> DOMTypedArray<WTFTypedArray, V8TypedArray>::wrap
(v8::Handle<v8::Object> creationContext, v8::Isolate*); \ | 44 template v8::Handle<v8::Object> DOMTypedArray<WTFTypedArray, V8TypedArray>::wrap
(v8::Handle<v8::Object> creationContext, v8::Isolate*); \ |
| 45 template v8::Handle<v8::Object> DOMTypedArray<WTFTypedArray, V8TypedArray>::asso
ciateWithWrapper(const WrapperTypeInfo*, v8::Handle<v8::Object> wrapper, v8::Iso
late*) | 45 template v8::Handle<v8::Object> DOMTypedArray<WTFTypedArray, V8TypedArray>::asso
ciateWithWrapper(const WrapperTypeInfo*, v8::Handle<v8::Object> wrapper, v8::Iso
late*) |
| 46 | 46 |
| 47 INSTANTIATE_DOMTYPEDARRAY_MEMBER_FUNCTIONS(Int8); | 47 INSTANTIATE_DOMTYPEDARRAY_MEMBER_FUNCTIONS(Int8); |
| 48 INSTANTIATE_DOMTYPEDARRAY_MEMBER_FUNCTIONS(Int16); | 48 INSTANTIATE_DOMTYPEDARRAY_MEMBER_FUNCTIONS(Int16); |
| 49 INSTANTIATE_DOMTYPEDARRAY_MEMBER_FUNCTIONS(Int32); | 49 INSTANTIATE_DOMTYPEDARRAY_MEMBER_FUNCTIONS(Int32); |
| 50 INSTANTIATE_DOMTYPEDARRAY_MEMBER_FUNCTIONS(Uint8); | 50 INSTANTIATE_DOMTYPEDARRAY_MEMBER_FUNCTIONS(Uint8); |
| 51 INSTANTIATE_DOMTYPEDARRAY_MEMBER_FUNCTIONS(Uint8Clamped); | 51 INSTANTIATE_DOMTYPEDARRAY_MEMBER_FUNCTIONS(Uint8Clamped); |
| 52 INSTANTIATE_DOMTYPEDARRAY_MEMBER_FUNCTIONS(Uint16); | 52 INSTANTIATE_DOMTYPEDARRAY_MEMBER_FUNCTIONS(Uint16); |
| 53 INSTANTIATE_DOMTYPEDARRAY_MEMBER_FUNCTIONS(Uint32); | 53 INSTANTIATE_DOMTYPEDARRAY_MEMBER_FUNCTIONS(Uint32); |
| 54 INSTANTIATE_DOMTYPEDARRAY_MEMBER_FUNCTIONS(Float32); | 54 INSTANTIATE_DOMTYPEDARRAY_MEMBER_FUNCTIONS(Float32); |
| 55 INSTANTIATE_DOMTYPEDARRAY_MEMBER_FUNCTIONS(Float64); | 55 INSTANTIATE_DOMTYPEDARRAY_MEMBER_FUNCTIONS(Float64); |
| 56 | 56 |
| 57 #undef INSTANTIATE_DOMTYPEDARRAY_MEMBER_FUNCTIONS | 57 #undef INSTANTIATE_DOMTYPEDARRAY_MEMBER_FUNCTIONS |
| 58 #undef INSTANTIATE_DOMTYPEDARRAY_MEMBER_FUNCTIONS_IMPL | 58 #undef INSTANTIATE_DOMTYPEDARRAY_MEMBER_FUNCTIONS_IMPL |
| 59 | 59 |
| 60 } // namespace blink | 60 } // namespace blink |
| OLD | NEW |