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

Side by Side Diff: Source/bindings/tests/results/V8Float64Array.cpp

Issue 14244017: Make length property return useful values for DOM bindings functions (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Replace [Optional] by optional Created 7 years, 8 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
OLDNEW
1 /* 1 /*
2 This file is part of the WebKit open source project. 2 This file is part of the WebKit open source project.
3 This file has been generated by generate-bindings.pl. DO NOT MODIFY! 3 This file has been generated by generate-bindings.pl. 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 "BindingState.h" 24 #include "BindingState.h"
25 #include "ContextFeatures.h" 25 #include "ContextFeatures.h"
26 #include "ExceptionCode.h" 26 #include "ExceptionCode.h"
27 #include "Frame.h" 27 #include "Frame.h"
28 #include "RuntimeEnabledFeatures.h" 28 #include "RuntimeEnabledFeatures.h"
29 #include "ScriptController.h"
29 #include "V8ArrayBufferView.h" 30 #include "V8ArrayBufferView.h"
30 #include "V8ArrayBufferViewCustom.h" 31 #include "V8ArrayBufferViewCustom.h"
31 #include "V8Binding.h" 32 #include "V8Binding.h"
32 #include "V8DOMWrapper.h" 33 #include "V8DOMWrapper.h"
33 #include "V8Float32Array.h" 34 #include "V8Float32Array.h"
34 #include "V8Int32Array.h" 35 #include "V8Int32Array.h"
35 #include <wtf/Float32Array.h> 36 #include <wtf/Float32Array.h>
36 #include <wtf/Float64Array.h> 37 #include <wtf/Float64Array.h>
37 #include <wtf/GetPtr.h> 38 #include <wtf/GetPtr.h>
38 #include <wtf/Int32Array.h> 39 #include <wtf/Int32Array.h>
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 v8::Handle<v8::Object> wrap(Float64Array* impl, v8::Handle<v8::Object> creationC ontext, v8::Isolate* isolate) 115 v8::Handle<v8::Object> wrap(Float64Array* impl, v8::Handle<v8::Object> creationC ontext, v8::Isolate* isolate)
115 { 116 {
116 ASSERT(impl); 117 ASSERT(impl);
117 v8::Handle<v8::Object> wrapper = V8Float64Array::createWrapper(impl, creatio nContext, isolate); 118 v8::Handle<v8::Object> wrapper = V8Float64Array::createWrapper(impl, creatio nContext, isolate);
118 if (!wrapper.IsEmpty()) 119 if (!wrapper.IsEmpty())
119 wrapper->SetIndexedPropertiesToExternalArrayData(impl->baseAddress(), v8 ::kExternalDoubleArray, impl->length()); 120 wrapper->SetIndexedPropertiesToExternalArrayData(impl->baseAddress(), v8 ::kExternalDoubleArray, impl->length());
120 return wrapper; 121 return wrapper;
121 } 122 }
122 123
123 static const V8DOMConfiguration::BatchedMethod V8Float64ArrayMethods[] = { 124 static const V8DOMConfiguration::BatchedMethod V8Float64ArrayMethods[] = {
124 {"set", Float64ArrayV8Internal::setMethodCallback, 0}, 125 {"set", Float64ArrayV8Internal::setMethodCallback, 0, 0},
125 }; 126 };
126 127
127 v8::Handle<v8::Value> V8Float64Array::constructorCallback(const v8::Arguments& a rgs) 128 v8::Handle<v8::Value> V8Float64Array::constructorCallback(const v8::Arguments& a rgs)
128 { 129 {
129 if (!args.IsConstructCall()) 130 if (!args.IsConstructCall())
130 return throwTypeError("DOM object constructor cannot be called as a func tion.", args.GetIsolate()); 131 return throwTypeError("DOM object constructor cannot be called as a func tion.", args.GetIsolate());
131 132
132 if (ConstructorMode::current() == ConstructorMode::WrapExistingObject) 133 if (ConstructorMode::current() == ConstructorMode::WrapExistingObject)
133 return args.Holder(); 134 return args.Holder();
134 135
135 return Float64ArrayV8Internal::constructor(args); 136 return Float64ArrayV8Internal::constructor(args);
136 } 137 }
137 138
138 static v8::Persistent<v8::FunctionTemplate> ConfigureV8Float64ArrayTemplate(v8:: Persistent<v8::FunctionTemplate> desc, v8::Isolate* isolate, WrapperWorldType cu rrentWorldType) 139 static v8::Persistent<v8::FunctionTemplate> ConfigureV8Float64ArrayTemplate(v8:: Persistent<v8::FunctionTemplate> desc, v8::Isolate* isolate, WrapperWorldType cu rrentWorldType)
139 { 140 {
140 desc->ReadOnlyPrototype(); 141 desc->ReadOnlyPrototype();
141 142
142 v8::Local<v8::Signature> defaultSignature; 143 v8::Local<v8::Signature> defaultSignature;
143 defaultSignature = V8DOMConfiguration::configureTemplate(desc, "Float64Array ", V8ArrayBufferView::GetTemplate(isolate, currentWorldType), V8Float64Array::in ternalFieldCount, 144 defaultSignature = V8DOMConfiguration::configureTemplate(desc, "Float64Array ", V8ArrayBufferView::GetTemplate(isolate, currentWorldType), V8Float64Array::in ternalFieldCount,
144 0, 0, 145 0, 0,
145 V8Float64ArrayMethods, WTF_ARRAY_LENGTH(V8Float64ArrayMethods), isolate, currentWorldType); 146 V8Float64ArrayMethods, WTF_ARRAY_LENGTH(V8Float64ArrayMethods), isolate, currentWorldType);
146 UNUSED_PARAM(defaultSignature); // In some cases, it will not be used. 147 UNUSED_PARAM(defaultSignature); // In some cases, it will not be used.
147 desc->SetCallHandler(V8Float64Array::constructorCallback); 148 desc->SetCallHandler(V8Float64Array::constructorCallback);
149 desc->SetLength(1);
148 v8::Local<v8::ObjectTemplate> instance = desc->InstanceTemplate(); 150 v8::Local<v8::ObjectTemplate> instance = desc->InstanceTemplate();
149 v8::Local<v8::ObjectTemplate> proto = desc->PrototypeTemplate(); 151 v8::Local<v8::ObjectTemplate> proto = desc->PrototypeTemplate();
150 UNUSED_PARAM(instance); // In some cases, it will not be used. 152 UNUSED_PARAM(instance); // In some cases, it will not be used.
151 UNUSED_PARAM(proto); // In some cases, it will not be used. 153 UNUSED_PARAM(proto); // In some cases, it will not be used.
152 154
153 // Custom Signature 'foo' 155 // Custom Signature 'foo'
154 const int fooArgc = 1; 156 const int fooArgc = 1;
155 v8::Handle<v8::FunctionTemplate> fooArgv[fooArgc] = { V8PerIsolateData::from (isolate)->rawTemplate(&V8Float32Array::info, currentWorldType) }; 157 v8::Handle<v8::FunctionTemplate> fooArgv[fooArgc] = { V8PerIsolateData::from (isolate)->rawTemplate(&V8Float32Array::info, currentWorldType) };
156 v8::Handle<v8::Signature> fooSignature = v8::Signature::New(desc, fooArgc, f ooArgv); 158 v8::Handle<v8::Signature> fooSignature = v8::Signature::New(desc, fooArgc, f ooArgv);
157 proto->Set(v8::String::NewSymbol("foo"), v8::FunctionTemplate::New(Float64Ar rayV8Internal::fooMethodCallback, v8Undefined(), fooSignature)); 159 proto->Set(v8::String::NewSymbol("foo"), v8::FunctionTemplate::New(Float64Ar rayV8Internal::fooMethodCallback, v8Undefined(), fooSignature));
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 installPerContextProperties(wrapper, impl.get(), isolate); 207 installPerContextProperties(wrapper, impl.get(), isolate);
206 V8DOMWrapper::associateObjectWithWrapper(impl, &info, wrapper, isolate, hasD ependentLifetime ? WrapperConfiguration::Dependent : WrapperConfiguration::Indep endent); 208 V8DOMWrapper::associateObjectWithWrapper(impl, &info, wrapper, isolate, hasD ependentLifetime ? WrapperConfiguration::Dependent : WrapperConfiguration::Indep endent);
207 return wrapper; 209 return wrapper;
208 } 210 }
209 void V8Float64Array::derefObject(void* object) 211 void V8Float64Array::derefObject(void* object)
210 { 212 {
211 static_cast<Float64Array*>(object)->deref(); 213 static_cast<Float64Array*>(object)->deref();
212 } 214 }
213 215
214 } // namespace WebCore 216 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/scripts/IDLParser.pm ('k') | Source/bindings/tests/results/V8TestActiveDOMObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698