OLD | NEW |
1 /* | 1 /* |
2 This file is part of the Blink open source project. | 2 This file is part of the Blink open source project. |
3 This file has been auto-generated by CodeGeneratorV8.pm. DO NOT MODIFY! | 3 This file has been auto-generated by CodeGeneratorV8.pm. DO NOT MODIFY! |
4 | 4 |
5 This library is free software; you can redistribute it and/or | 5 This library is free software; you can redistribute it and/or |
6 modify it under the terms of the GNU Library General Public | 6 modify it under the terms of the GNU Library General Public |
7 License as published by the Free Software Foundation; either | 7 License as published by the Free Software Foundation; either |
8 version 2 of the License, or (at your option) any later version. | 8 version 2 of the License, or (at your option) any later version. |
9 | 9 |
10 This library is distributed in the hope that it will be useful, | 10 This library is distributed in the hope that it will be useful, |
11 but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 Library General Public License for more details. | 13 Library General Public License for more details. |
14 | 14 |
15 You should have received a copy of the GNU Library General Public License | 15 You should have received a copy of the GNU Library General Public License |
16 along with this library; see the file COPYING.LIB. If not, write to | 16 along with this library; see the file COPYING.LIB. If not, write to |
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
18 Boston, MA 02111-1307, USA. | 18 Boston, MA 02111-1307, USA. |
19 */ | 19 */ |
20 | 20 |
21 #include "config.h" | 21 #include "config.h" |
22 #include "V8Float64Array.h" | 22 #include "V8Float64Array.h" |
23 | 23 |
24 #include "RuntimeEnabledFeatures.h" | 24 #include "RuntimeEnabledFeatures.h" |
25 #include "V8ArrayBufferView.h" | 25 #include "V8ArrayBufferView.h" |
26 #include "V8Float32Array.h" | |
27 #include "V8Int32Array.h" | |
28 #include "bindings/v8/ExceptionState.h" | 26 #include "bindings/v8/ExceptionState.h" |
29 #include "bindings/v8/ScriptController.h" | 27 #include "bindings/v8/ScriptController.h" |
30 #include "bindings/v8/V8Binding.h" | 28 #include "bindings/v8/V8Binding.h" |
31 #include "bindings/v8/V8DOMConfiguration.h" | 29 #include "bindings/v8/V8DOMConfiguration.h" |
32 #include "bindings/v8/V8DOMWrapper.h" | 30 #include "bindings/v8/V8DOMWrapper.h" |
33 #include "bindings/v8/V8ObjectConstructor.h" | 31 #include "bindings/v8/V8ObjectConstructor.h" |
34 #include "bindings/v8/custom/V8ArrayBufferCustom.h" | 32 #include "bindings/v8/custom/V8ArrayBufferCustom.h" |
35 #include "bindings/v8/custom/V8ArrayBufferViewCustom.h" | 33 #include "bindings/v8/custom/V8ArrayBufferViewCustom.h" |
| 34 #include "bindings/v8/custom/V8Float32ArrayCustom.h" |
| 35 #include "bindings/v8/custom/V8Float64ArrayCustom.h" |
| 36 #include "bindings/v8/custom/V8Int32ArrayCustom.h" |
36 #include "core/dom/ContextFeatures.h" | 37 #include "core/dom/ContextFeatures.h" |
37 #include "core/dom/Document.h" | 38 #include "core/dom/Document.h" |
38 #include "core/page/Frame.h" | 39 #include "core/page/Frame.h" |
39 #include "core/platform/chromium/TraceEvent.h" | 40 #include "core/platform/chromium/TraceEvent.h" |
40 #include "wtf/GetPtr.h" | 41 #include "wtf/GetPtr.h" |
41 #include "wtf/RefPtr.h" | 42 #include "wtf/RefPtr.h" |
42 #include "wtf/UnusedParam.h" | 43 #include "wtf/UnusedParam.h" |
43 | 44 |
44 namespace WebCore { | 45 namespace WebCore { |
45 | 46 |
(...skipping 23 matching lines...) Expand all Loading... |
69 | 70 |
70 template <typename T> void V8_USE(T) { } | 71 template <typename T> void V8_USE(T) { } |
71 | 72 |
72 static void fooMethod(const v8::FunctionCallbackInfo<v8::Value>& args) | 73 static void fooMethod(const v8::FunctionCallbackInfo<v8::Value>& args) |
73 { | 74 { |
74 if (args.Length() < 1) { | 75 if (args.Length() < 1) { |
75 throwNotEnoughArgumentsError(args.GetIsolate()); | 76 throwNotEnoughArgumentsError(args.GetIsolate()); |
76 return; | 77 return; |
77 } | 78 } |
78 Float64Array* imp = V8Float64Array::toNative(args.Holder()); | 79 Float64Array* imp = V8Float64Array::toNative(args.Holder()); |
79 V8TRYCATCH_VOID(Float32Array*, array, V8Float32Array::HasInstance(args[0], a
rgs.GetIsolate(), worldType(args.GetIsolate())) ? V8Float32Array::toNative(v8::H
andle<v8::Object>::Cast(args[0])) : 0); | 80 V8TRYCATCH_VOID(Float32Array*, array, args[0]->IsFloat32Array() ? V8Float32A
rray::toNative(v8::Handle<v8::Float32Array>::Cast(args[0])) : 0); |
80 v8SetReturnValue(args, toV8(imp->foo(array), args.Holder(), args.GetIsolate(
))); | 81 v8SetReturnValue(args, toV8(imp->foo(array), args.Holder(), args.GetIsolate(
))); |
81 return; | 82 return; |
82 } | 83 } |
83 | 84 |
84 static void fooMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& args) | 85 static void fooMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& args) |
85 { | 86 { |
86 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 87 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
87 Float64ArrayV8Internal::fooMethod(args); | 88 Float64ArrayV8Internal::fooMethod(args); |
88 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 89 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
89 } | 90 } |
90 | 91 |
91 static void setMethod(const v8::FunctionCallbackInfo<v8::Value>& args) | 92 static void setMethod(const v8::FunctionCallbackInfo<v8::Value>& args) |
92 { | 93 { |
93 setWebGLArrayHelper<Float64Array, V8Float64Array>(args); | 94 setWebGLArrayHelper<Float64Array, V8Float64Array>(args); |
94 } | 95 } |
95 | 96 |
96 static void setMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& args) | 97 static void setMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& args) |
97 { | 98 { |
98 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 99 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
99 Float64ArrayV8Internal::setMethod(args); | 100 Float64ArrayV8Internal::setMethod(args); |
100 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 101 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
101 } | 102 } |
102 | 103 |
103 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& args) | |
104 { | |
105 return constructWebGLArray<Float64Array, V8Float64Array, double>(args, &V8Fl
oat64Array::info, v8::kExternalDoubleArray); | |
106 } | |
107 | |
108 static void indexedPropertyGetterCallback(uint32_t index, const v8::PropertyCall
backInfo<v8::Value>& info) | 104 static void indexedPropertyGetterCallback(uint32_t index, const v8::PropertyCall
backInfo<v8::Value>& info) |
109 { | 105 { |
110 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMIndexedProperty"); | 106 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMIndexedProperty"); |
111 V8Float64Array::indexedPropertyGetterCustom(index, info); | 107 V8Float64Array::indexedPropertyGetterCustom(index, info); |
112 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 108 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
113 } | 109 } |
114 | 110 |
115 static void indexedPropertySetterCallback(uint32_t index, v8::Local<v8::Value> v
alue, const v8::PropertyCallbackInfo<v8::Value>& info) | 111 static void indexedPropertySetterCallback(uint32_t index, v8::Local<v8::Value> v
alue, const v8::PropertyCallbackInfo<v8::Value>& info) |
116 { | 112 { |
117 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMIndexedProperty"); | 113 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMIndexedProperty"); |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 desc->SetCallHandler(V8Float64Array::constructorCallback); | 158 desc->SetCallHandler(V8Float64Array::constructorCallback); |
163 desc->SetLength(1); | 159 desc->SetLength(1); |
164 v8::Local<v8::ObjectTemplate> instance = desc->InstanceTemplate(); | 160 v8::Local<v8::ObjectTemplate> instance = desc->InstanceTemplate(); |
165 v8::Local<v8::ObjectTemplate> proto = desc->PrototypeTemplate(); | 161 v8::Local<v8::ObjectTemplate> proto = desc->PrototypeTemplate(); |
166 UNUSED_PARAM(instance); // In some cases, it will not be used. | 162 UNUSED_PARAM(instance); // In some cases, it will not be used. |
167 UNUSED_PARAM(proto); // In some cases, it will not be used. | 163 UNUSED_PARAM(proto); // In some cases, it will not be used. |
168 desc->InstanceTemplate()->SetIndexedPropertyHandler(Float64ArrayV8Internal::
indexedPropertyGetterCallback, Float64ArrayV8Internal::indexedPropertySetterCall
back, 0, 0, indexedPropertyEnumerator<Float64Array>); | 164 desc->InstanceTemplate()->SetIndexedPropertyHandler(Float64ArrayV8Internal::
indexedPropertyGetterCallback, Float64ArrayV8Internal::indexedPropertySetterCall
back, 0, 0, indexedPropertyEnumerator<Float64Array>); |
169 | 165 |
170 // Custom Signature 'foo' | 166 // Custom Signature 'foo' |
171 const int fooArgc = 1; | 167 const int fooArgc = 1; |
172 v8::Handle<v8::FunctionTemplate> fooArgv[fooArgc] = { V8PerIsolateData::from
(isolate)->rawTemplate(&V8Float32Array::info, currentWorldType) }; | 168 v8::Handle<v8::FunctionTemplate> fooArgv[fooArgc] = { v8::Handle<v8::Functio
nTemplate>() }; |
173 v8::Handle<v8::Signature> fooSignature = v8::Signature::New(desc, fooArgc, f
ooArgv); | 169 v8::Handle<v8::Signature> fooSignature = v8::Signature::New(desc, fooArgc, f
ooArgv); |
174 proto->Set(v8::String::NewSymbol("foo"), v8::FunctionTemplate::New(Float64Ar
rayV8Internal::fooMethodCallback, v8Undefined(), fooSignature, 1)); | 170 proto->Set(v8::String::NewSymbol("foo"), v8::FunctionTemplate::New(Float64Ar
rayV8Internal::fooMethodCallback, v8Undefined(), fooSignature, 1)); |
175 | 171 |
176 // Custom toString template | 172 // Custom toString template |
177 desc->Set(v8::String::NewSymbol("toString"), V8PerIsolateData::current()->to
StringTemplate()); | 173 desc->Set(v8::String::NewSymbol("toString"), V8PerIsolateData::current()->to
StringTemplate()); |
178 return desc; | 174 return desc; |
179 } | 175 } |
180 | 176 |
181 v8::Handle<v8::FunctionTemplate> V8Float64Array::GetTemplate(v8::Isolate* isolat
e, WrapperWorldType currentWorldType) | 177 v8::Handle<v8::FunctionTemplate> V8Float64Array::GetTemplate(v8::Isolate* isolat
e, WrapperWorldType currentWorldType) |
182 { | 178 { |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 installPerContextProperties(wrapper, impl.get(), isolate); | 224 installPerContextProperties(wrapper, impl.get(), isolate); |
229 V8DOMWrapper::associateObjectWithWrapper<V8Float64Array>(impl, &info, wrappe
r, isolate, WrapperConfiguration::Independent); | 225 V8DOMWrapper::associateObjectWithWrapper<V8Float64Array>(impl, &info, wrappe
r, isolate, WrapperConfiguration::Independent); |
230 return wrapper; | 226 return wrapper; |
231 } | 227 } |
232 void V8Float64Array::derefObject(void* object) | 228 void V8Float64Array::derefObject(void* object) |
233 { | 229 { |
234 fromInternalPointer(object)->deref(); | 230 fromInternalPointer(object)->deref(); |
235 } | 231 } |
236 | 232 |
237 } // namespace WebCore | 233 } // namespace WebCore |
OLD | NEW |