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

Unified Diff: Source/bindings/tests/results/V8TestEventTarget.cpp

Issue 18677002: [Binding] use V8TRYCATCH_VOID and raw pointer in indexed setter (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: Created 7 years, 5 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
Index: Source/bindings/tests/results/V8TestEventTarget.cpp
diff --git a/Source/bindings/tests/results/V8TestEventTarget.cpp b/Source/bindings/tests/results/V8TestEventTarget.cpp
index d716404cff104a43386ff89809560f2b6813864c..1cab30098fa6077b4bb6d86afe7986918db2c1dd 100644
--- a/Source/bindings/tests/results/V8TestEventTarget.cpp
+++ b/Source/bindings/tests/results/V8TestEventTarget.cpp
@@ -183,6 +183,23 @@ static void indexedPropertyGetterCallback(uint32_t index, const v8::PropertyCall
TRACE_EVENT_SAMPLING_STATE0("V8\0V8-Execution");
}
+static void indexedPropertySetter(uint32_t index, v8::Local<v8::Value> value, const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+ TestEventTarget* collection = V8TestEventTarget::toNative(info.Holder());
+ V8TRYCATCH_VOID(Node*, propertyValue, V8Node::HasInstance(value, info.GetIsolate(), worldType(info.GetIsolate())) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(value)) : 0);
+ bool result = collection->anonymousIndexedSetter(index, propertyValue);
+ if (!result)
+ return;
+ v8SetReturnValue(info, value);
+}
+
+static void indexedPropertySetterCallback(uint32_t index, v8::Local<v8::Value> value, const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+ TRACE_EVENT_SAMPLING_STATE0("Blink\0Blink-DOMIndexedProperty");
+ TestEventTargetV8Internal::indexedPropertySetter(index, value, info);
+ TRACE_EVENT_SAMPLING_STATE0("V8\0V8-Execution");
+}
+
static void indexedPropertyDeleter(unsigned index, const v8::PropertyCallbackInfo<v8::Boolean>& info)
{
TestEventTarget* collection = V8TestEventTarget::toNative(info.Holder());
@@ -337,7 +354,7 @@ static v8::Handle<v8::FunctionTemplate> ConfigureV8TestEventTargetTemplate(v8::H
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.
- desc->InstanceTemplate()->SetIndexedPropertyHandler(TestEventTargetV8Internal::indexedPropertyGetterCallback, 0, 0, TestEventTargetV8Internal::indexedPropertyDeleterCallback, indexedPropertyEnumerator<TestEventTarget>);
+ desc->InstanceTemplate()->SetIndexedPropertyHandler(TestEventTargetV8Internal::indexedPropertyGetterCallback, TestEventTargetV8Internal::indexedPropertySetterCallback, 0, TestEventTargetV8Internal::indexedPropertyDeleterCallback, indexedPropertyEnumerator<TestEventTarget>);
desc->InstanceTemplate()->SetNamedPropertyHandler(TestEventTargetV8Internal::namedPropertyGetterCallback, TestEventTargetV8Internal::namedPropertySetterCallback, TestEventTargetV8Internal::namedPropertyQueryCallback, TestEventTargetV8Internal::namedPropertyDeleterCallback, TestEventTargetV8Internal::namedPropertyEnumeratorCallback);
desc->InstanceTemplate()->MarkAsUndetectable();
« Source/bindings/scripts/CodeGeneratorV8.pm ('K') | « Source/bindings/tests/idls/TestEventTarget.idl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698