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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/bindings/scripts/CodeGeneratorV8.pm ('k') | Source/core/dom/NamedNodeMap.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/tests/results/V8TestEventTarget.cpp
diff --git a/Source/bindings/tests/results/V8TestEventTarget.cpp b/Source/bindings/tests/results/V8TestEventTarget.cpp
index 660296df97977c820bf2280f8212ef8902fa3220..e9604781647bc87383a4f191506495e1e6df3a12 100644
--- a/Source/bindings/tests/results/V8TestEventTarget.cpp
+++ b/Source/bindings/tests/results/V8TestEventTarget.cpp
@@ -174,6 +174,15 @@ static const V8DOMConfiguration::BatchedMethod V8TestEventTargetMethods[] = {
{"removeEventListener", TestEventTargetV8Internal::removeEventListenerMethodCallback, 0},
};
+v8::Handle<v8::Value> V8TestEventTarget::indexedPropertyGetter(uint32_t index, const v8::AccessorInfo& info)
+{
+ ASSERT(V8DOMWrapper::maybeDOMWrapper(info.Holder()));
+ TestEventTarget* collection = toNative(info.Holder());
+ RefPtr<Node> element = collection->item(index);
+ if (!element)
+ return v8Undefined();
+ return toV8(element.release(), info.Holder(), info.GetIsolate());
+}
v8::Handle<v8::Value> V8TestEventTarget::namedPropertyGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(name).IsEmpty())
@@ -211,7 +220,7 @@ static v8::Persistent<v8::FunctionTemplate> ConfigureV8TestEventTargetTemplate(v
v8::Local<v8::ObjectTemplate> proto = desc->PrototypeTemplate();
UNUSED_PARAM(instance); // In some cases, it will not be used.
UNUSED_PARAM(proto); // In some cases, it will not be used.
- setCollectionIndexedGetter<TestEventTarget, Node>(desc);
+ desc->InstanceTemplate()->SetIndexedPropertyHandler(V8TestEventTarget::indexedPropertyGetter, 0, 0, 0, nodeCollectionIndexedPropertyEnumerator<TestEventTarget>);
desc->InstanceTemplate()->SetNamedPropertyHandler(V8TestEventTarget::namedPropertyGetter, 0, 0, 0, 0);
desc->InstanceTemplate()->MarkAsUndetectable();
« 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