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 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY! | 5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY! |
6 | 6 |
7 #include "V8TestInterface3.h" | 7 #include "V8TestInterface3.h" |
8 | 8 |
9 #include "bindings/core/v8/ExceptionState.h" | 9 #include "bindings/core/v8/ExceptionState.h" |
10 #include "bindings/core/v8/ScriptState.h" | 10 #include "bindings/core/v8/ScriptState.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 #pragma clang diagnostic pop | 32 #pragma clang diagnostic pop |
33 #endif | 33 #endif |
34 | 34 |
35 // This static member must be declared by DEFINE_WRAPPERTYPEINFO in TestInterfac
e3.h. | 35 // This static member must be declared by DEFINE_WRAPPERTYPEINFO in TestInterfac
e3.h. |
36 // For details, see the comment of DEFINE_WRAPPERTYPEINFO in | 36 // For details, see the comment of DEFINE_WRAPPERTYPEINFO in |
37 // bindings/core/v8/ScriptWrappable.h. | 37 // bindings/core/v8/ScriptWrappable.h. |
38 const WrapperTypeInfo& TestInterface3::s_wrapperTypeInfo = V8TestInterface3::wra
pperTypeInfo; | 38 const WrapperTypeInfo& TestInterface3::s_wrapperTypeInfo = V8TestInterface3::wra
pperTypeInfo; |
39 | 39 |
40 namespace TestInterface3V8Internal { | 40 namespace TestInterface3V8Internal { |
41 | 41 |
| 42 static void readonlyStringifierAttributeAttributeGetter(const v8::FunctionCallba
ckInfo<v8::Value>& info) |
| 43 { |
| 44 v8::Local<v8::Object> holder = info.Holder(); |
| 45 TestInterface3* impl = V8TestInterface3::toImpl(holder); |
| 46 v8SetReturnValueString(info, impl->readonlyStringifierAttribute(), info.GetI
solate()); |
| 47 } |
| 48 |
| 49 static void readonlyStringifierAttributeAttributeGetterCallback(const v8::Functi
onCallbackInfo<v8::Value>& info) |
| 50 { |
| 51 TestInterface3V8Internal::readonlyStringifierAttributeAttributeGetter(info); |
| 52 } |
| 53 |
42 static void voidMethodDocumentMethod(const v8::FunctionCallbackInfo<v8::Value>&
info) | 54 static void voidMethodDocumentMethod(const v8::FunctionCallbackInfo<v8::Value>&
info) |
43 { | 55 { |
44 if (UNLIKELY(info.Length() < 1)) { | 56 if (UNLIKELY(info.Length() < 1)) { |
45 V8ThrowException::throwException(createMinimumArityTypeErrorForMethod(in
fo.GetIsolate(), "voidMethodDocument", "TestInterface3", 1, info.Length()), info
.GetIsolate()); | 57 V8ThrowException::throwException(createMinimumArityTypeErrorForMethod(in
fo.GetIsolate(), "voidMethodDocument", "TestInterface3", 1, info.Length()), info
.GetIsolate()); |
46 return; | 58 return; |
47 } | 59 } |
48 TestInterface3* impl = V8TestInterface3::toImpl(info.Holder()); | 60 TestInterface3* impl = V8TestInterface3::toImpl(info.Holder()); |
49 Document* document; | 61 Document* document; |
50 { | 62 { |
51 document = V8Document::toImplWithTypeCheck(info.GetIsolate(), info[0]); | 63 document = V8Document::toImplWithTypeCheck(info.GetIsolate(), info[0]); |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 exceptionState.throwIfNeeded(); | 154 exceptionState.throwIfNeeded(); |
143 return; | 155 return; |
144 } | 156 } |
145 } | 157 } |
146 | 158 |
147 static void forEachMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& inf
o) | 159 static void forEachMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& inf
o) |
148 { | 160 { |
149 TestInterface3V8Internal::forEachMethod(info); | 161 TestInterface3V8Internal::forEachMethod(info); |
150 } | 162 } |
151 | 163 |
| 164 static void toStringMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 165 { |
| 166 TestInterface3* impl = V8TestInterface3::toImpl(info.Holder()); |
| 167 v8SetReturnValueString(info, impl->readonlyStringifierAttribute(), info.GetI
solate()); |
| 168 } |
| 169 |
| 170 static void toStringMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& in
fo) |
| 171 { |
| 172 TestInterface3V8Internal::toStringMethod(info); |
| 173 } |
| 174 |
152 static void iteratorMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 175 static void iteratorMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
153 { | 176 { |
154 ExceptionState exceptionState(ExceptionState::ExecutionContext, "iterator",
"TestInterface3", info.Holder(), info.GetIsolate()); | 177 ExceptionState exceptionState(ExceptionState::ExecutionContext, "iterator",
"TestInterface3", info.Holder(), info.GetIsolate()); |
155 TestInterface3* impl = V8TestInterface3::toImpl(info.Holder()); | 178 TestInterface3* impl = V8TestInterface3::toImpl(info.Holder()); |
156 ScriptState* scriptState = ScriptState::current(info.GetIsolate()); | 179 ScriptState* scriptState = ScriptState::current(info.GetIsolate()); |
157 Iterator* result = impl->iterator(scriptState, exceptionState); | 180 Iterator* result = impl->iterator(scriptState, exceptionState); |
158 if (exceptionState.hadException()) { | 181 if (exceptionState.hadException()) { |
159 exceptionState.throwIfNeeded(); | 182 exceptionState.throwIfNeeded(); |
160 return; | 183 return; |
161 } | 184 } |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 V8TestInterface3::namedPropertyDeleterCustom(name, info); | 225 V8TestInterface3::namedPropertyDeleterCustom(name, info); |
203 } | 226 } |
204 | 227 |
205 static void namedPropertyEnumeratorCallback(const v8::PropertyCallbackInfo<v8::A
rray>& info) | 228 static void namedPropertyEnumeratorCallback(const v8::PropertyCallbackInfo<v8::A
rray>& info) |
206 { | 229 { |
207 V8TestInterface3::namedPropertyEnumeratorCustom(info); | 230 V8TestInterface3::namedPropertyEnumeratorCustom(info); |
208 } | 231 } |
209 | 232 |
210 } // namespace TestInterface3V8Internal | 233 } // namespace TestInterface3V8Internal |
211 | 234 |
| 235 const V8DOMConfiguration::AccessorConfiguration V8TestInterface3Accessors[] = { |
| 236 {"readonlyStringifierAttribute", TestInterface3V8Internal::readonlyStringifi
erAttributeAttributeGetterCallback, 0, 0, 0, 0, v8::DEFAULT, static_cast<v8::Pro
pertyAttribute>(v8::ReadOnly), V8DOMConfiguration::ExposedToAllScripts, V8DOMCon
figuration::OnPrototype, V8DOMConfiguration::CheckHolder}, |
| 237 }; |
| 238 |
212 const V8DOMConfiguration::MethodConfiguration V8TestInterface3Methods[] = { | 239 const V8DOMConfiguration::MethodConfiguration V8TestInterface3Methods[] = { |
213 {"voidMethodDocument", TestInterface3V8Internal::voidMethodDocumentMethodCal
lback, 0, 1, v8::None, V8DOMConfiguration::ExposedToAllScripts, V8DOMConfigurati
on::OnPrototype}, | 240 {"voidMethodDocument", TestInterface3V8Internal::voidMethodDocumentMethodCal
lback, 0, 1, v8::None, V8DOMConfiguration::ExposedToAllScripts, V8DOMConfigurati
on::OnPrototype}, |
| 241 {"toString", TestInterface3V8Internal::toStringMethodCallback, 0, 0, v8::Non
e, V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype}, |
214 }; | 242 }; |
215 | 243 |
216 static void installV8TestInterface3Template(v8::Isolate* isolate, const DOMWrapp
erWorld& world, v8::Local<v8::FunctionTemplate> interfaceTemplate) | 244 static void installV8TestInterface3Template(v8::Isolate* isolate, const DOMWrapp
erWorld& world, v8::Local<v8::FunctionTemplate> interfaceTemplate) |
217 { | 245 { |
218 // Initialize the interface object's template. | 246 // Initialize the interface object's template. |
219 V8DOMConfiguration::initializeDOMInterfaceTemplate(isolate, interfaceTemplat
e, V8TestInterface3::wrapperTypeInfo.interfaceName, v8::Local<v8::FunctionTempla
te>(), V8TestInterface3::internalFieldCount); | 247 V8DOMConfiguration::initializeDOMInterfaceTemplate(isolate, interfaceTemplat
e, V8TestInterface3::wrapperTypeInfo.interfaceName, v8::Local<v8::FunctionTempla
te>(), V8TestInterface3::internalFieldCount); |
220 v8::Local<v8::Signature> signature = v8::Signature::New(isolate, interfaceTe
mplate); | 248 v8::Local<v8::Signature> signature = v8::Signature::New(isolate, interfaceTe
mplate); |
221 ALLOW_UNUSED_LOCAL(signature); | 249 ALLOW_UNUSED_LOCAL(signature); |
222 v8::Local<v8::ObjectTemplate> instanceTemplate = interfaceTemplate->Instance
Template(); | 250 v8::Local<v8::ObjectTemplate> instanceTemplate = interfaceTemplate->Instance
Template(); |
223 ALLOW_UNUSED_LOCAL(instanceTemplate); | 251 ALLOW_UNUSED_LOCAL(instanceTemplate); |
224 v8::Local<v8::ObjectTemplate> prototypeTemplate = interfaceTemplate->Prototy
peTemplate(); | 252 v8::Local<v8::ObjectTemplate> prototypeTemplate = interfaceTemplate->Prototy
peTemplate(); |
225 ALLOW_UNUSED_LOCAL(prototypeTemplate); | 253 ALLOW_UNUSED_LOCAL(prototypeTemplate); |
226 // Register DOM constants, attributes and operations. | 254 // Register DOM constants, attributes and operations. |
| 255 V8DOMConfiguration::installAccessors(isolate, world, instanceTemplate, proto
typeTemplate, interfaceTemplate, signature, V8TestInterface3Accessors, WTF_ARRAY
_LENGTH(V8TestInterface3Accessors)); |
227 V8DOMConfiguration::installMethods(isolate, world, instanceTemplate, prototy
peTemplate, interfaceTemplate, signature, V8TestInterface3Methods, WTF_ARRAY_LEN
GTH(V8TestInterface3Methods)); | 256 V8DOMConfiguration::installMethods(isolate, world, instanceTemplate, prototy
peTemplate, interfaceTemplate, signature, V8TestInterface3Methods, WTF_ARRAY_LEN
GTH(V8TestInterface3Methods)); |
228 | 257 |
229 // Indexed properties | 258 // Indexed properties |
230 v8::IndexedPropertyHandlerConfiguration indexedPropertyHandlerConfig(TestInt
erface3V8Internal::indexedPropertyGetterCallback, TestInterface3V8Internal::inde
xedPropertySetterCallback, 0, TestInterface3V8Internal::indexedPropertyDeleterCa
llback, indexedPropertyEnumerator<TestInterface3>, v8::Local<v8::Value>(), v8::P
ropertyHandlerFlags::kNone); | 259 v8::IndexedPropertyHandlerConfiguration indexedPropertyHandlerConfig(TestInt
erface3V8Internal::indexedPropertyGetterCallback, TestInterface3V8Internal::inde
xedPropertySetterCallback, 0, TestInterface3V8Internal::indexedPropertyDeleterCa
llback, indexedPropertyEnumerator<TestInterface3>, v8::Local<v8::Value>(), v8::P
ropertyHandlerFlags::kNone); |
231 instanceTemplate->SetHandler(indexedPropertyHandlerConfig); | 260 instanceTemplate->SetHandler(indexedPropertyHandlerConfig); |
232 // Named properties | 261 // Named properties |
233 v8::NamedPropertyHandlerConfiguration namedPropertyHandlerConfig(TestInterfa
ce3V8Internal::namedPropertyGetterCallback, TestInterface3V8Internal::namedPrope
rtySetterCallback, TestInterface3V8Internal::namedPropertyQueryCallback, TestInt
erface3V8Internal::namedPropertyDeleterCallback, TestInterface3V8Internal::named
PropertyEnumeratorCallback, v8::Local<v8::Value>(), static_cast<v8::PropertyHand
lerFlags>(int(v8::PropertyHandlerFlags::kOnlyInterceptStrings) | int(v8::Propert
yHandlerFlags::kNonMasking))); | 262 v8::NamedPropertyHandlerConfiguration namedPropertyHandlerConfig(TestInterfa
ce3V8Internal::namedPropertyGetterCallback, TestInterface3V8Internal::namedPrope
rtySetterCallback, TestInterface3V8Internal::namedPropertyQueryCallback, TestInt
erface3V8Internal::namedPropertyDeleterCallback, TestInterface3V8Internal::named
PropertyEnumeratorCallback, v8::Local<v8::Value>(), static_cast<v8::PropertyHand
lerFlags>(int(v8::PropertyHandlerFlags::kOnlyInterceptStrings) | int(v8::Propert
yHandlerFlags::kNonMasking))); |
234 instanceTemplate->SetHandler(namedPropertyHandlerConfig); | 263 instanceTemplate->SetHandler(namedPropertyHandlerConfig); |
235 | 264 |
236 if (RuntimeEnabledFeatures::featureNameEnabled()) { | 265 if (RuntimeEnabledFeatures::featureNameEnabled()) { |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 { | 300 { |
272 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrappe
rTypeInfo, v8Value); | 301 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrappe
rTypeInfo, v8Value); |
273 } | 302 } |
274 | 303 |
275 TestInterface3* V8TestInterface3::toImplWithTypeCheck(v8::Isolate* isolate, v8::
Local<v8::Value> value) | 304 TestInterface3* V8TestInterface3::toImplWithTypeCheck(v8::Isolate* isolate, v8::
Local<v8::Value> value) |
276 { | 305 { |
277 return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(valu
e)) : 0; | 306 return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(valu
e)) : 0; |
278 } | 307 } |
279 | 308 |
280 } // namespace blink | 309 } // namespace blink |
OLD | NEW |