| OLD | NEW |
| 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, |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 | 167 |
| 168 } // namespace TestEventTargetV8Internal | 168 } // namespace TestEventTargetV8Internal |
| 169 | 169 |
| 170 static const V8DOMConfiguration::BatchedMethod V8TestEventTargetMethods[] = { | 170 static const V8DOMConfiguration::BatchedMethod V8TestEventTargetMethods[] = { |
| 171 {"item", TestEventTargetV8Internal::itemMethodCallback, 0}, | 171 {"item", TestEventTargetV8Internal::itemMethodCallback, 0}, |
| 172 {"namedItem", TestEventTargetV8Internal::namedItemMethodCallback, 0}, | 172 {"namedItem", TestEventTargetV8Internal::namedItemMethodCallback, 0}, |
| 173 {"addEventListener", TestEventTargetV8Internal::addEventListenerMethodCallba
ck, 0}, | 173 {"addEventListener", TestEventTargetV8Internal::addEventListenerMethodCallba
ck, 0}, |
| 174 {"removeEventListener", TestEventTargetV8Internal::removeEventListenerMethod
Callback, 0}, | 174 {"removeEventListener", TestEventTargetV8Internal::removeEventListenerMethod
Callback, 0}, |
| 175 }; | 175 }; |
| 176 | 176 |
| 177 v8::Handle<v8::Value> V8TestEventTarget::namedPropertyGetter(v8::Local<v8::Strin
g> name, const v8::AccessorInfo& info) |
| 178 { |
| 179 if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(name).IsEmpty()) |
| 180 return v8Undefined(); |
| 181 if (info.Holder()->HasRealNamedCallbackProperty(name)) |
| 182 return v8Undefined(); |
| 183 |
| 184 v8::Local<v8::Object> object = info.Holder(); |
| 185 v8::Handle<v8::Object> creationContext = info.Holder(); |
| 186 v8::Isolate* isolate = info.GetIsolate(); |
| 187 |
| 188 ASSERT(V8DOMWrapper::maybeDOMWrapper(object)); |
| 189 ASSERT(toWrapperTypeInfo(object) != &V8Node::info); |
| 190 TestEventTarget* collection = toNative(object); |
| 191 |
| 192 AtomicString propertyName = toWebCoreAtomicStringWithNullCheck(name); |
| 193 RefPtr<Node> element = collection->namedItem(propertyName); |
| 194 |
| 195 if (!element) |
| 196 return v8Undefined(); |
| 197 |
| 198 return toV8(element.release(), creationContext, isolate); |
| 199 } |
| 200 |
| 177 static v8::Persistent<v8::FunctionTemplate> ConfigureV8TestEventTargetTemplate(v
8::Persistent<v8::FunctionTemplate> desc, v8::Isolate* isolate, WrapperWorldType
currentWorldType) | 201 static v8::Persistent<v8::FunctionTemplate> ConfigureV8TestEventTargetTemplate(v
8::Persistent<v8::FunctionTemplate> desc, v8::Isolate* isolate, WrapperWorldType
currentWorldType) |
| 178 { | 202 { |
| 179 desc->ReadOnlyPrototype(); | 203 desc->ReadOnlyPrototype(); |
| 180 | 204 |
| 181 v8::Local<v8::Signature> defaultSignature; | 205 v8::Local<v8::Signature> defaultSignature; |
| 182 defaultSignature = V8DOMConfiguration::configureTemplate(desc, "TestEventTar
get", v8::Persistent<v8::FunctionTemplate>(), V8TestEventTarget::internalFieldCo
unt, | 206 defaultSignature = V8DOMConfiguration::configureTemplate(desc, "TestEventTar
get", v8::Persistent<v8::FunctionTemplate>(), V8TestEventTarget::internalFieldCo
unt, |
| 183 0, 0, | 207 0, 0, |
| 184 V8TestEventTargetMethods, WTF_ARRAY_LENGTH(V8TestEventTargetMethods), is
olate, currentWorldType); | 208 V8TestEventTargetMethods, WTF_ARRAY_LENGTH(V8TestEventTargetMethods), is
olate, currentWorldType); |
| 185 UNUSED_PARAM(defaultSignature); // In some cases, it will not be used. | 209 UNUSED_PARAM(defaultSignature); // In some cases, it will not be used. |
| 186 v8::Local<v8::ObjectTemplate> instance = desc->InstanceTemplate(); | 210 v8::Local<v8::ObjectTemplate> instance = desc->InstanceTemplate(); |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 return V8PerIsolateData::from(isolate)->hasInstance(&info, value, MainWorld) | 250 return V8PerIsolateData::from(isolate)->hasInstance(&info, value, MainWorld) |
| 227 || V8PerIsolateData::from(isolate)->hasInstance(&info, value, IsolatedWo
rld) | 251 || V8PerIsolateData::from(isolate)->hasInstance(&info, value, IsolatedWo
rld) |
| 228 || V8PerIsolateData::from(isolate)->hasInstance(&info, value, WorkerWorl
d); | 252 || V8PerIsolateData::from(isolate)->hasInstance(&info, value, WorkerWorl
d); |
| 229 } | 253 } |
| 230 | 254 |
| 231 EventTarget* V8TestEventTarget::toEventTarget(v8::Handle<v8::Object> object) | 255 EventTarget* V8TestEventTarget::toEventTarget(v8::Handle<v8::Object> object) |
| 232 { | 256 { |
| 233 return toNative(object); | 257 return toNative(object); |
| 234 } | 258 } |
| 235 | 259 |
| 236 v8::Handle<v8::Value> V8TestEventTarget::namedPropertyGetter(v8::Local<v8::Strin
g> name, const v8::AccessorInfo& info) | |
| 237 { | |
| 238 if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(name).IsEmpty()) | |
| 239 return v8Undefined(); | |
| 240 if (info.Holder()->HasRealNamedCallbackProperty(name)) | |
| 241 return v8Undefined(); | |
| 242 | |
| 243 v8::Local<v8::Object> object = info.Holder(); | |
| 244 v8::Handle<v8::Object> creationContext = info.Holder(); | |
| 245 v8::Isolate* isolate = info.GetIsolate(); | |
| 246 | |
| 247 ASSERT(V8DOMWrapper::maybeDOMWrapper(object)); | |
| 248 ASSERT(toWrapperTypeInfo(object) != &V8Node::info); | |
| 249 TestEventTarget* collection = toNative(object); | |
| 250 | |
| 251 AtomicString propertyName = toWebCoreAtomicStringWithNullCheck(name); | |
| 252 RefPtr<Node> element = collection->namedItem(propertyName); | |
| 253 | |
| 254 if (!element) | |
| 255 return v8Undefined(); | |
| 256 | |
| 257 return toV8(element.release(), creationContext, isolate); | |
| 258 } | |
| 259 | 260 |
| 260 v8::Handle<v8::Object> V8TestEventTarget::createWrapper(PassRefPtr<TestEventTarg
et> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) | 261 v8::Handle<v8::Object> V8TestEventTarget::createWrapper(PassRefPtr<TestEventTarg
et> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) |
| 261 { | 262 { |
| 262 ASSERT(impl.get()); | 263 ASSERT(impl.get()); |
| 263 ASSERT(DOMDataStore::getWrapper(impl.get(), isolate).IsEmpty()); | 264 ASSERT(DOMDataStore::getWrapper(impl.get(), isolate).IsEmpty()); |
| 264 | 265 |
| 265 #if ENABLE(BINDING_INTEGRITY) | 266 #if ENABLE(BINDING_INTEGRITY) |
| 266 checkTypeOrDieTrying(impl.get()); | 267 checkTypeOrDieTrying(impl.get()); |
| 267 #endif | 268 #endif |
| 268 | 269 |
| 269 v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext
, &info, impl.get(), isolate); | 270 v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext
, &info, impl.get(), isolate); |
| 270 if (UNLIKELY(wrapper.IsEmpty())) | 271 if (UNLIKELY(wrapper.IsEmpty())) |
| 271 return wrapper; | 272 return wrapper; |
| 272 | 273 |
| 273 installPerContextProperties(wrapper, impl.get(), isolate); | 274 installPerContextProperties(wrapper, impl.get(), isolate); |
| 274 V8DOMWrapper::associateObjectWithWrapper(impl, &info, wrapper, isolate, hasD
ependentLifetime ? WrapperConfiguration::Dependent : WrapperConfiguration::Indep
endent); | 275 V8DOMWrapper::associateObjectWithWrapper(impl, &info, wrapper, isolate, hasD
ependentLifetime ? WrapperConfiguration::Dependent : WrapperConfiguration::Indep
endent); |
| 275 return wrapper; | 276 return wrapper; |
| 276 } | 277 } |
| 277 void V8TestEventTarget::derefObject(void* object) | 278 void V8TestEventTarget::derefObject(void* object) |
| 278 { | 279 { |
| 279 static_cast<TestEventTarget*>(object)->deref(); | 280 static_cast<TestEventTarget*>(object)->deref(); |
| 280 } | 281 } |
| 281 | 282 |
| 282 } // namespace WebCore | 283 } // namespace WebCore |
| OLD | NEW |