Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(218)

Side by Side Diff: Source/core/dom/DOMTypedArray.cpp

Issue 1112203003: Replace v8::Handle with v8::Local in core/dom/* (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/dom/DOMTypedArray.h ('k') | Source/core/dom/Element.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
11 #include "bindings/core/v8/V8Float32Array.h" 11 #include "bindings/core/v8/V8Float32Array.h"
12 #include "bindings/core/v8/V8Float64Array.h" 12 #include "bindings/core/v8/V8Float64Array.h"
13 #include "bindings/core/v8/V8Int16Array.h" 13 #include "bindings/core/v8/V8Int16Array.h"
14 #include "bindings/core/v8/V8Int32Array.h" 14 #include "bindings/core/v8/V8Int32Array.h"
15 #include "bindings/core/v8/V8Int8Array.h" 15 #include "bindings/core/v8/V8Int8Array.h"
16 #include "bindings/core/v8/V8Uint16Array.h" 16 #include "bindings/core/v8/V8Uint16Array.h"
17 #include "bindings/core/v8/V8Uint32Array.h" 17 #include "bindings/core/v8/V8Uint32Array.h"
18 #include "bindings/core/v8/V8Uint8Array.h" 18 #include "bindings/core/v8/V8Uint8Array.h"
19 #include "bindings/core/v8/V8Uint8ClampedArray.h" 19 #include "bindings/core/v8/V8Uint8ClampedArray.h"
20 20
21 namespace blink { 21 namespace blink {
22 22
23 template<typename WTFTypedArray, typename V8TypedArray> 23 template<typename WTFTypedArray, typename V8TypedArray>
24 v8::Handle<v8::Object> DOMTypedArray<WTFTypedArray, V8TypedArray>::wrap(v8::Hand le<v8::Object> creationContext, v8::Isolate* isolate) 24 v8::Local<v8::Object> DOMTypedArray<WTFTypedArray, V8TypedArray>::wrap(v8::Local <v8::Object> creationContext, v8::Isolate* isolate)
25 { 25 {
26 // It's possible that no one except for the new wrapper owns this object at 26 // It's possible that no one except for the new wrapper owns this object at
27 // this moment, so we have to prevent GC to collect this object until the 27 // this moment, so we have to prevent GC to collect this object until the
28 // object gets associated with the wrapper. 28 // object gets associated with the wrapper.
29 RefPtr<ThisType> protect(this); 29 RefPtr<ThisType> protect(this);
30 30
31 ASSERT(!DOMDataStore::containsWrapper(this, isolate)); 31 ASSERT(!DOMDataStore::containsWrapper(this, isolate));
32 32
33 const WrapperTypeInfo* wrapperTypeInfo = this->wrapperTypeInfo(); 33 const WrapperTypeInfo* wrapperTypeInfo = this->wrapperTypeInfo();
34 RefPtr<DOMArrayBuffer> buffer = this->buffer(); 34 RefPtr<DOMArrayBuffer> buffer = this->buffer();
35 v8::Local<v8::Value> v8Buffer = toV8(buffer.get(), creationContext, isolate) ; 35 v8::Local<v8::Value> v8Buffer = toV8(buffer.get(), creationContext, isolate) ;
36 ASSERT(v8Buffer->IsArrayBuffer()); 36 ASSERT(v8Buffer->IsArrayBuffer());
37 37
38 v8::Handle<v8::Object> wrapper = V8TypedArray::New(v8Buffer.As<v8::ArrayBuff er>(), byteOffset(), length()); 38 v8::Local<v8::Object> wrapper = V8TypedArray::New(v8Buffer.As<v8::ArrayBuffe r>(), byteOffset(), length());
39 39
40 return associateWithWrapper(isolate, wrapperTypeInfo, wrapper); 40 return associateWithWrapper(isolate, wrapperTypeInfo, wrapper);
41 } 41 }
42 42
43 template<typename WTFTypedArray, typename V8TypedArray> 43 template<typename WTFTypedArray, typename V8TypedArray>
44 v8::Handle<v8::Object> DOMTypedArray<WTFTypedArray, V8TypedArray>::associateWith Wrapper(v8::Isolate* isolate, const WrapperTypeInfo* wrapperTypeInfo, v8::Handle <v8::Object> wrapper) 44 v8::Local<v8::Object> DOMTypedArray<WTFTypedArray, V8TypedArray>::associateWithW rapper(v8::Isolate* isolate, const WrapperTypeInfo* wrapperTypeInfo, v8::Local<v 8::Object> wrapper)
45 { 45 {
46 return V8DOMWrapper::associateObjectWithWrapper(isolate, this, wrapperTypeIn fo, wrapper); 46 return V8DOMWrapper::associateObjectWithWrapper(isolate, this, wrapperTypeIn fo, wrapper);
47 } 47 }
48 48
49 // TODO(tasak): The following traits should be auto-generated by binding 49 // TODO(tasak): The following traits should be auto-generated by binding
50 // script and should be placed in bindings/core/v8/V8*Array.h. 50 // script and should be placed in bindings/core/v8/V8*Array.h.
51 template <typename ArrayType> struct DOMTypedArrayTraits { }; 51 template <typename ArrayType> struct DOMTypedArrayTraits { };
52 52
53 #define DEFINE_DOMTYPEDARRAY_TRAITS(ArrayType, V8BindingType) \ 53 #define DEFINE_DOMTYPEDARRAY_TRAITS(ArrayType, V8BindingType) \
54 template <> \ 54 template <> \
(...skipping 21 matching lines...) Expand all
76 template class CORE_EXPORT DOMTypedArray<WTF::Int16Array, v8::Int16Array>; 76 template class CORE_EXPORT DOMTypedArray<WTF::Int16Array, v8::Int16Array>;
77 template class CORE_EXPORT DOMTypedArray<WTF::Int32Array, v8::Int32Array>; 77 template class CORE_EXPORT DOMTypedArray<WTF::Int32Array, v8::Int32Array>;
78 template class CORE_EXPORT DOMTypedArray<WTF::Uint8Array, v8::Uint8Array>; 78 template class CORE_EXPORT DOMTypedArray<WTF::Uint8Array, v8::Uint8Array>;
79 template class CORE_EXPORT DOMTypedArray<WTF::Uint8ClampedArray, v8::Uint8Clampe dArray>; 79 template class CORE_EXPORT DOMTypedArray<WTF::Uint8ClampedArray, v8::Uint8Clampe dArray>;
80 template class CORE_EXPORT DOMTypedArray<WTF::Uint16Array, v8::Uint16Array>; 80 template class CORE_EXPORT DOMTypedArray<WTF::Uint16Array, v8::Uint16Array>;
81 template class CORE_EXPORT DOMTypedArray<WTF::Uint32Array, v8::Uint32Array>; 81 template class CORE_EXPORT DOMTypedArray<WTF::Uint32Array, v8::Uint32Array>;
82 template class CORE_EXPORT DOMTypedArray<WTF::Float32Array, v8::Float32Array>; 82 template class CORE_EXPORT DOMTypedArray<WTF::Float32Array, v8::Float32Array>;
83 template class CORE_EXPORT DOMTypedArray<WTF::Float64Array, v8::Float64Array>; 83 template class CORE_EXPORT DOMTypedArray<WTF::Float64Array, v8::Float64Array>;
84 84
85 } // namespace blink 85 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/dom/DOMTypedArray.h ('k') | Source/core/dom/Element.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698