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

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

Issue 13933014: Gen index getter by unified way instead of using several helper function in some special cases. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: refined 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
« no previous file with comments | « Source/bindings/scripts/CodeGeneratorV8.pm ('k') | Source/core/dom/NamedNodeMap.idl » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
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::indexedPropertyGetter(uint32_t index, c onst v8::AccessorInfo& info)
178 {
179 ASSERT(V8DOMWrapper::maybeDOMWrapper(info.Holder()));
180 TestEventTarget* collection = toNative(info.Holder());
181 RefPtr<Node> element = collection->item(index);
182 if (!element)
183 return v8Undefined();
184 return toV8(element.release(), info.Holder(), info.GetIsolate());
185 }
177 v8::Handle<v8::Value> V8TestEventTarget::namedPropertyGetter(v8::Local<v8::Strin g> name, const v8::AccessorInfo& info) 186 v8::Handle<v8::Value> V8TestEventTarget::namedPropertyGetter(v8::Local<v8::Strin g> name, const v8::AccessorInfo& info)
178 { 187 {
179 if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(name).IsEmpty()) 188 if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(name).IsEmpty())
180 return v8Undefined(); 189 return v8Undefined();
181 if (info.Holder()->HasRealNamedCallbackProperty(name)) 190 if (info.Holder()->HasRealNamedCallbackProperty(name))
182 return v8Undefined(); 191 return v8Undefined();
183 192
184 v8::Local<v8::Object> object = info.Holder(); 193 v8::Local<v8::Object> object = info.Holder();
185 v8::Handle<v8::Object> creationContext = info.Holder(); 194 v8::Handle<v8::Object> creationContext = info.Holder();
186 v8::Isolate* isolate = info.GetIsolate(); 195 v8::Isolate* isolate = info.GetIsolate();
(...skipping 17 matching lines...) Expand all
204 213
205 v8::Local<v8::Signature> defaultSignature; 214 v8::Local<v8::Signature> defaultSignature;
206 defaultSignature = V8DOMConfiguration::configureTemplate(desc, "TestEventTar get", v8::Persistent<v8::FunctionTemplate>(), V8TestEventTarget::internalFieldCo unt, 215 defaultSignature = V8DOMConfiguration::configureTemplate(desc, "TestEventTar get", v8::Persistent<v8::FunctionTemplate>(), V8TestEventTarget::internalFieldCo unt,
207 0, 0, 216 0, 0,
208 V8TestEventTargetMethods, WTF_ARRAY_LENGTH(V8TestEventTargetMethods), is olate, currentWorldType); 217 V8TestEventTargetMethods, WTF_ARRAY_LENGTH(V8TestEventTargetMethods), is olate, currentWorldType);
209 UNUSED_PARAM(defaultSignature); // In some cases, it will not be used. 218 UNUSED_PARAM(defaultSignature); // In some cases, it will not be used.
210 v8::Local<v8::ObjectTemplate> instance = desc->InstanceTemplate(); 219 v8::Local<v8::ObjectTemplate> instance = desc->InstanceTemplate();
211 v8::Local<v8::ObjectTemplate> proto = desc->PrototypeTemplate(); 220 v8::Local<v8::ObjectTemplate> proto = desc->PrototypeTemplate();
212 UNUSED_PARAM(instance); // In some cases, it will not be used. 221 UNUSED_PARAM(instance); // In some cases, it will not be used.
213 UNUSED_PARAM(proto); // In some cases, it will not be used. 222 UNUSED_PARAM(proto); // In some cases, it will not be used.
214 setCollectionIndexedGetter<TestEventTarget, Node>(desc); 223 desc->InstanceTemplate()->SetIndexedPropertyHandler(V8TestEventTarget::index edPropertyGetter, 0, 0, 0, nodeCollectionIndexedPropertyEnumerator<TestEventTarg et>);
215 desc->InstanceTemplate()->SetNamedPropertyHandler(V8TestEventTarget::namedPr opertyGetter, 0, 0, 0, 0); 224 desc->InstanceTemplate()->SetNamedPropertyHandler(V8TestEventTarget::namedPr opertyGetter, 0, 0, 0, 0);
216 desc->InstanceTemplate()->MarkAsUndetectable(); 225 desc->InstanceTemplate()->MarkAsUndetectable();
217 226
218 // Custom Signature 'dispatchEvent' 227 // Custom Signature 'dispatchEvent'
219 const int dispatchEventArgc = 1; 228 const int dispatchEventArgc = 1;
220 v8::Handle<v8::FunctionTemplate> dispatchEventArgv[dispatchEventArgc] = { V8 PerIsolateData::from(isolate)->rawTemplate(&V8Event::info, currentWorldType) }; 229 v8::Handle<v8::FunctionTemplate> dispatchEventArgv[dispatchEventArgc] = { V8 PerIsolateData::from(isolate)->rawTemplate(&V8Event::info, currentWorldType) };
221 v8::Handle<v8::Signature> dispatchEventSignature = v8::Signature::New(desc, dispatchEventArgc, dispatchEventArgv); 230 v8::Handle<v8::Signature> dispatchEventSignature = v8::Signature::New(desc, dispatchEventArgc, dispatchEventArgv);
222 proto->Set(v8::String::NewSymbol("dispatchEvent"), v8::FunctionTemplate::New (TestEventTargetV8Internal::dispatchEventMethodCallback, v8Undefined(), dispatch EventSignature)); 231 proto->Set(v8::String::NewSymbol("dispatchEvent"), v8::FunctionTemplate::New (TestEventTargetV8Internal::dispatchEventMethodCallback, v8Undefined(), dispatch EventSignature));
223 232
224 // Custom toString template 233 // Custom toString template
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 installPerContextProperties(wrapper, impl.get(), isolate); 283 installPerContextProperties(wrapper, impl.get(), isolate);
275 V8DOMWrapper::associateObjectWithWrapper(impl, &info, wrapper, isolate, hasD ependentLifetime ? WrapperConfiguration::Dependent : WrapperConfiguration::Indep endent); 284 V8DOMWrapper::associateObjectWithWrapper(impl, &info, wrapper, isolate, hasD ependentLifetime ? WrapperConfiguration::Dependent : WrapperConfiguration::Indep endent);
276 return wrapper; 285 return wrapper;
277 } 286 }
278 void V8TestEventTarget::derefObject(void* object) 287 void V8TestEventTarget::derefObject(void* object)
279 { 288 {
280 static_cast<TestEventTarget*>(object)->deref(); 289 static_cast<TestEventTarget*>(object)->deref();
281 } 290 }
282 291
283 } // namespace WebCore 292 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/scripts/CodeGeneratorV8.pm ('k') | Source/core/dom/NamedNodeMap.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698